Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- minetest.register_abm( {
- nodenames = { 'hopper:hopper' },
- interval = 1.0,
- chance = 1,
- action = function ( pos, node )
- local fromnode, tonode,
- local frompos = { x = pos.x, y = pos.y, z = pos.z }
- local topos = { x = pos.x, y = pos.y, z = pos.z }
- local facedir = node.param2
- if facedir == 0 then
- frompos.y = frompos.y + 1
- topos.y = topos.y - 1
- elseif facedir == 1 then
- frompos.y = frompos.y + 1
- topos.y = topos.y - 1
- elseif facedir == 2 then
- frompos.y = frompos.y + 1
- topos.y = topos.y - 1
- elseif facedir == 3 then
- frompos.y = frompos.y + 1
- topos.y = topos.y - 1
- end
- fromnode = minetest.get_node( frompos ).name
- tonode = minetest.get_node( topos ).name
- if hopper_transactions[fromnode] and hopper_transactions[tonode] then
- local wl = hopper_transactions[tonode].wishlist
- if wl == nil and hopper_transactions[tonode].get_wishlist ~= nil then
- wl = hopper_transactions[tonode].get_wishlist( topos )
- end
- hopper_transactions[tonode].add(
- topos,
- hopper_transactions[fromnode].get( frompos, wl ),
- function ( thing )
- hopper_transactions[fromnode].add( frompos, thing )
- end
- )
- end
- end
- } )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement