diff options
author | Auke Kok <sofar+github@foo-projects.org> | 2017-04-29 21:35:46 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-29 21:35:46 -0700 |
commit | c4adcee072a0ddcc241f67409453c7b540acfcfd (patch) | |
tree | 3020336c54ab1eafbc95e8cdcbdfcc9d1502a029 | |
parent | 215a33ee9afa9726e7af5b96f03d642807014c60 (diff) | |
parent | 21f981163e1a7605e6e866cf378b8efd6e0c6de1 (diff) |
Merge branch 'master' into master
-rw-r--r-- | depends.txt | 3 | ||||
-rw-r--r-- | shop.lua | 18 |
2 files changed, 19 insertions, 2 deletions
diff --git a/depends.txt b/depends.txt index b474c2d..b650e9b 100644 --- a/depends.txt +++ b/depends.txt @@ -1,3 +1,4 @@ default intllib? -loot?
\ No newline at end of file +loot? +pipeworks?
\ No newline at end of file @@ -94,7 +94,7 @@ minetest.register_node("currency:shop", { "shop_side.png",
"shop_front.png"},
inventory_image = "shop_front.png",
- groups = {choppy=2,oddly_breakable_by_hand=2},
+ groups = {choppy=2,oddly_breakable_by_hand=2,tubedevice=1,tubedevice_receiver=1},
sounds = default.node_sound_wood_defaults(),
after_place_node = function(pos, placer, itemstack)
local owner = placer:get_player_name()
@@ -108,7 +108,23 @@ minetest.register_node("currency:shop", { inv:set_size("stock", 3*2)
inv:set_size("owner_wants", 3*2)
inv:set_size("owner_gives", 3*2)
+ if minetest.get_modpath("pipeworks") then pipeworks.after_place(pos) end
end,
+ after_dig_node = (pipeworks and pipeworks.after_dig),
+ tube = {
+ insert_object = function(pos, node, stack, direction)
+ local meta = minetest.get_meta(pos)
+ local inv = meta:get_inventory()
+ return inv:add_item("stock",stack)
+ end,
+ can_insert = function(pos,node,stack,direction)
+ local meta = minetest.get_meta(pos)
+ local inv = meta:get_inventory()
+ return inv:room_for_item("stock", stack)
+ end,
+ input_inventory = "customers_gave",
+ connect_sides = {left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1}
+ },
on_rightclick = function(pos, node, clicker, itemstack)
clicker:get_inventory():set_size("customer_gives", 3*2)
clicker:get_inventory():set_size("customer_gets", 3*2)
|