Use get_item_group accessor in hopper code

This commit is contained in:
wallabra 2022-02-19 12:36:06 -03:00
parent 2c8194bd6d
commit 024904eadd
Signed by: Gustavo6046
GPG Key ID: 5182FABAA5E139B3
1 changed files with 4 additions and 4 deletions

View File

@ -343,7 +343,7 @@ minetest.register_abm({
local abovenode = minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z})
if not minetest.registered_items[abovenode.name] then return end
-- Don't bother checking item enties if node above is a container (should save some CPU)
if minetest.registered_items[abovenode.name].groups.container then
if get_item_group(abovenode.name, "container") then
return
end
local meta = minetest.get_meta(pos)
@ -399,7 +399,7 @@ minetest.register_abm({
-- Suck an item from the container above into the hopper
local upnode = minetest.get_node(uppos)
if not minetest.registered_nodes[upnode.name] then return end
local g = minetest.registered_nodes[upnode.name].groups.container
local g = get_item_group(upnode.name, "container")
local sucked = mcl_util.move_item_container(uppos, pos)
-- Also suck in non-fuel items from furnace fuel slot
@ -444,7 +444,7 @@ minetest.register_abm({
-- Suck an item from the container above into the hopper
local abovenode = minetest.get_node(above)
if not minetest.registered_nodes[abovenode.name] then return end
local g = minetest.registered_nodes[abovenode.name].groups.container
local g = get_item_group(abovenode.name, "container")
local sucked = mcl_util.move_item_container(above, pos)
-- Also suck in non-fuel items from furnace fuel slot
@ -461,7 +461,7 @@ minetest.register_abm({
if mcl_util.move_item_container(pos, downpos) then return end
-- Move an item from the hopper into the container to which the hopper points to
local g = minetest.registered_nodes[frontnode.name].groups.container
local g = get_item_group(frontnode.name, "container")
if g == 2 or g == 3 or g == 5 or g == 6 then
mcl_util.move_item_container(pos, front)
elseif g == 4 then