diff --git a/mods/ENTITIES/mcl_item_entity/init.lua b/mods/ENTITIES/mcl_item_entity/init.lua index 678f8e2b7..3891c78ac 100644 --- a/mods/ENTITIES/mcl_item_entity/init.lua +++ b/mods/ENTITIES/mcl_item_entity/init.lua @@ -107,7 +107,9 @@ minetest.register_globalstep(function(dtime) local pos = player:get_pos() - if tick == true and pool[name] > 0 then + local pool_name = pool[name] + + if tick == true and pool_name and pool_name > 0 then minetest.sound_play("item_drop_pickup", { pos = pos, gain = 0.7, diff --git a/mods/ENVIRONMENT/mcl_moon/init.lua b/mods/ENVIRONMENT/mcl_moon/init.lua index 09b080810..cd285195c 100644 --- a/mods/ENVIRONMENT/mcl_moon/init.lua +++ b/mods/ENVIRONMENT/mcl_moon/init.lua @@ -55,10 +55,16 @@ minetest.register_globalstep(function(dtime) for p=1, #players do if players[p].set_moon then players[p]:set_moon(moon_arg) + else + -- TODO: use old sky api end end end) minetest.register_on_joinplayer(function(player) - player:set_moon({texture = get_moon_texture(), scale=3.75}) + if player.set_moon then + player:set_moon({texture = get_moon_texture(), scale=3.75}) + else + -- TODO: use old sky api + end end) diff --git a/mods/PLAYER/mcl_player/init.lua b/mods/PLAYER/mcl_player/init.lua index 2a4c25c34..bc20e6962 100644 --- a/mods/PLAYER/mcl_player/init.lua +++ b/mods/PLAYER/mcl_player/init.lua @@ -90,6 +90,11 @@ end local function set_texture(player, index, texture) local textures = player_textures[player:get_player_name()] + if not textures then + -- TODO: Check if minetest.register_on_joinplayer() shouldn't really work in minetest 5.1.1? + player_textures[player:get_player_name()] = {"blank.png", "blank.png", "blank.png"} + textures = player_textures[player:get_player_name()] + end textures[index] = texture player:set_properties({textures = textures}) end diff --git a/mods/PLAYER/mcl_playerplus/init.lua b/mods/PLAYER/mcl_playerplus/init.lua index 825a468b1..f57344bc5 100644 --- a/mods/PLAYER/mcl_playerplus/init.lua +++ b/mods/PLAYER/mcl_playerplus/init.lua @@ -277,6 +277,11 @@ minetest.register_globalstep(function(dtime) local fly_node = minetest.get_node({x = fly_pos.x, y = fly_pos.y - 0.5, z = fly_pos.z}).name local elytra = mcl_playerplus.elytra[player] + if not elytra then + mcl_playerplus.elytra[player] = {} + elytra = mcl_playerplus.elytra[player] + end + elytra.active = player:get_inventory():get_stack("armor", 3):get_name() == "mcl_armor:elytra" and not player:get_attach() and (elytra.active or control.jump and player_velocity.y < -6) @@ -399,7 +404,8 @@ minetest.register_globalstep(function(dtime) -- Update jump status immediately since we need this info in real time. -- WARNING: This section is HACKY as hell since it is all just based on heuristics. - if mcl_playerplus_internal[name].jump_cooldown > 0 then + local mcl_playerplus_internal_name = mcl_playerplus_internal[name] + if mcl_playerplus_internal_name and mcl_playerplus_internal_name.jump_cooldown > 0 then mcl_playerplus_internal[name].jump_cooldown = mcl_playerplus_internal[name].jump_cooldown - dtime end @@ -614,6 +620,9 @@ minetest.register_globalstep(function(dtime) end -- Update internal values + if not mcl_playerplus_internal[name] then + mcl_playerplus_internal[name] = {} + end mcl_playerplus_internal[name].lastPos = pos end