forked from MineClone5/MineClone5
Use get_item_group accessor in hopper code
This commit is contained in:
parent
2c8194bd6d
commit
024904eadd
|
@ -343,7 +343,7 @@ minetest.register_abm({
|
||||||
local abovenode = minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z})
|
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
|
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)
|
-- 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
|
return
|
||||||
end
|
end
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
|
@ -399,7 +399,7 @@ minetest.register_abm({
|
||||||
-- Suck an item from the container above into the hopper
|
-- Suck an item from the container above into the hopper
|
||||||
local upnode = minetest.get_node(uppos)
|
local upnode = minetest.get_node(uppos)
|
||||||
if not minetest.registered_nodes[upnode.name] then return end
|
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)
|
local sucked = mcl_util.move_item_container(uppos, pos)
|
||||||
|
|
||||||
-- Also suck in non-fuel items from furnace fuel slot
|
-- 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
|
-- Suck an item from the container above into the hopper
|
||||||
local abovenode = minetest.get_node(above)
|
local abovenode = minetest.get_node(above)
|
||||||
if not minetest.registered_nodes[abovenode.name] then return end
|
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)
|
local sucked = mcl_util.move_item_container(above, pos)
|
||||||
|
|
||||||
-- Also suck in non-fuel items from furnace fuel slot
|
-- 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
|
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
|
-- 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
|
if g == 2 or g == 3 or g == 5 or g == 6 then
|
||||||
mcl_util.move_item_container(pos, front)
|
mcl_util.move_item_container(pos, front)
|
||||||
elseif g == 4 then
|
elseif g == 4 then
|
||||||
|
|
Loading…
Reference in New Issue