"disable_jump" if the legs are inside the node

This commit is contained in:
MoNTE48 2019-07-02 23:55:12 +02:00
parent e59ae03bf5
commit b68b7e36cf
2 changed files with 6 additions and 7 deletions

View File

@ -258,15 +258,8 @@ minetest.register_node("mobs:cobweb", {
drawtype = "plantlike",
visual_scale = 1.2,
tiles = {"mobs_cobweb.png"},
inventory_image = "mobs_cobweb.png",
paramtype = "light",
sunlight_propagates = true,
liquid_viscosity = 7,
liquidtype = "source",
liquid_alternative_flowing = "mobs:cobweb",
liquid_alternative_source = "mobs:cobweb",
liquid_renewable = false,
liquid_range = 0,
walkable = false,
groups = {snappy = 1, disable_jump = 1, speed = -30},
sounds = default.node_sound_leaves_defaults(),

View File

@ -497,6 +497,12 @@ void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d,
|| sneak_can_jump;
if (itemgroup_get(f.groups, "disable_jump"))
m_can_jump = false;
// Determine that the legs are inside the node
v3s16 pos = getStandingNodePos();
const ContentFeatures &f1 = nodemgr->get(map->getNodeNoEx(
pos + v3s16(0, 1, 0)));
if (itemgroup_get(f1.groups, "disable_jump"))
m_can_jump = false;
// Jump key pressed while jumping off from a bouncy block
if (m_can_jump && control.jump && itemgroup_get(f.groups, "bouncy") &&