Use get_definition() method instead of minetest.registered_items

This commit is contained in:
Zemtzov7
2023-10-04 12:36:25 +05:00
committed by GitHub
parent 5b75bde897
commit 9c1f758bc5

View File

@ -92,8 +92,7 @@ minetest.register_allow_player_inventory_action(function(player, action, invento
if inventory_info.to_list == "more_chests:wifi" or inventory_info.from_list == "more_chests:wifi" then
local pos = player:get_pos()
local witem = player:get_wielded_item()
local iname = witem and witem:get_name()
local def = iname and minetest.registered_items[iname]
local def = witem and witem:get_definition()
local range = def and def.range or (minetest.is_creative_enabled(player:get_player_name()) and 10 or 4)
local chest = minetest.find_node_near(pos, range, "more_chests:wifi")
if not chest then