diff options
author | h-v-smacker <hans-von-smacker+github@gmail.com> | 2017-11-16 21:18:10 +0300 |
---|---|---|
committer | h-v-smacker <hans-von-smacker+github@gmail.com> | 2017-11-16 21:18:10 +0300 |
commit | f74e12dc06fe948c7495990ab2a083e19c5c38be (patch) | |
tree | cc3d96e4c4394ce62029896d810f00bbb6b174d5 | |
parent | 1cff4309985a113b09289ba6c50262923631fbf4 (diff) | |
download | freezer-f74e12dc06fe948c7495990ab2a083e19c5c38be.tar.gz freezer-f74e12dc06fe948c7495990ab2a083e19c5c38be.tar.bz2 freezer-f74e12dc06fe948c7495990ab2a083e19c5c38be.zip |
Direction check is redundant here
-rw-r--r-- | init.lua | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -185,6 +185,7 @@ minetest.register_node("freezer:freezer", { sounds = default.node_sound_stone_defaults(), tube = (function() if minetest.get_modpath("pipeworks") then return { + -- using a different stack from defaut when inserting insert_object = function(pos, node, stack, direction) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() @@ -192,18 +193,14 @@ minetest.register_node("freezer:freezer", { if not timer:is_started() then timer:start(1.0) end - if direction.y == 1 then - return inv:add_item("src", stack) - end - + return inv:add_item("src", stack) end, can_insert = function(pos,node,stack,direction) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() - if direction.y == 1 then - return inv:room_for_item("src", stack) - end + return inv:room_for_item("src", stack) end, + -- the default stack, from which objects will be taken input_inventory = "dst", connect_sides = {left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1} } end end)(), |