Fix ender chest crash + remove map hand reference

This commit is contained in:
parent 2ad60b06ea
commit 8793ed211e
2 changed files with 2 additions and 3 deletions

View File

@ -1061,8 +1061,8 @@ minetest.register_allow_player_inventory_action(function(player, action, inv, in
or action == "take" and info.listname == "enderchest"
) then
local def = player:get_wielded_item():get_definition()
if not minetest.find_node_near(player:get_pos(), def and def.range or ItemStack():get_definition().range, "mcl_chests:ender_chest_small", true) then
local range = (def and def.range or player:get_inventory():get_stack("hand", 1):get_definition().range) + 1
if not minetest.find_node_near(player:get_pos(), range, "mcl_chests:ender_chest_small", true) then
return 0
end
end

View File

@ -238,7 +238,6 @@ filled_wield_def.wield_scale = { x = 1, y = 1, z = 1 }
filled_wield_def.paramtype = "light"
filled_wield_def.drawtype = "mesh"
filled_wield_def.node_placement_prediction = ""
filled_wield_def.range = minetest.registered_items[""].range
filled_wield_def.on_place = mcl_util.call_on_rightclick
filled_wield_def._mcl_wieldview_item = "mcl_maps:filled_map"