diff options
author | Novatux <nathanael.courant@laposte.net> | 2014-01-12 16:52:42 +0100 |
---|---|---|
committer | Novatux <nathanael.courant@laposte.net> | 2014-01-18 13:29:06 +0100 |
commit | b28001e36f1f92db13a103f6ba40f1cb891c26ae (patch) | |
tree | 819f71cec48217ce2d6bdd3ee3ddde5f59d6b4df | |
parent | e1c995f654d4ae9debdd0f783bff2913c261db8a (diff) |
Infinite stacks fix
-rw-r--r-- | technic/machines/other/frames.lua | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/technic/machines/other/frames.lua b/technic/machines/other/frames.lua index b3a179b..fed9d85 100644 --- a/technic/machines/other/frames.lua +++ b/technic/machines/other/frames.lua @@ -3,6 +3,8 @@ local S = technic.getter frames = {} +local infinite_stacks = minetest.setting_getbool("creative_mode") and minetest.get_modpath("unified_inventory") == nil + local frames_pos = {} -- Helpers @@ -220,6 +222,7 @@ local nodeboxes= { paramtype = "light", frame=1, drop="technic:frame_111111", + sunlight_propagates = true, frame_connect_all=function(nodename) l2={} l1={{x=-1,y=0,z=0},{x=1,y=0,z=0},{x=0,y=-1,z=0},{x=0,y=1,z=0},{x=0,y=0,z=-1},{x=0,y=0,z=1}} @@ -265,10 +268,12 @@ local nodeboxes= { else minetest.set_node(pos, {name = itemstack:get_name()}) end - itemstack:take_item() + if not infinite_stacks then + itemstack:take_item() + end return itemstack end, - on_rightclick = function(pos, node, placer, itemstack) + on_rightclick = function(pos, node, placer, itemstack, pointed_thing) if is_supported_node(itemstack:get_name()) then if minetest.is_protected(pos, placer:get_player_name()) then minetest.log("action", placer:get_player_name() @@ -312,6 +317,11 @@ local nodeboxes= { obj:get_luaentity():set_node({name=node.name}) return itemstack + else + --local pointed_thing = {type = "node", under = pos} + if pointed_thing then + minetest.item_place_node(itemstack, placer, pointed_thing) + end end end, }) |