From a532518d61ec1449fe71fd7b7b689787860d008e Mon Sep 17 00:00:00 2001 From: Sokomine Date: Thu, 6 Jan 2022 00:13:05 +0100 Subject: [PATCH 1/9] added mod.conf --- mod.conf | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 mod.conf diff --git a/mod.conf b/mod.conf new file mode 100644 index 0000000..8c822f8 --- /dev/null +++ b/mod.conf @@ -0,0 +1,5 @@ +name = chesttools +description = With these chests, you can access your bags and craft inventory with one click and move items between bag and chest. Other buttons speed up inventory movement even more: "DA": drop all from the selected inventory to the chest, "TA": take all from the chest and move it to your selected inventory, "SA": swap all items between chest and selected inventory and "FA": filter all - drop those items form your selected inventory to the chest of which there is already at least one in the chest. If the place where the chest stands is protected, everyone who can build there can access the chest (shared chest). You can also set a description text for the chests. Interaction with tubes is possible. +depends = default +author = Sokomine +title = Very useful chests which allow quick access to your bags. From 6d2bfe336a14934c4f73de5e3ddf01855ffbbd7a Mon Sep 17 00:00:00 2001 From: flux <25628292+fluxionary@users.noreply.github.com> Date: Fri, 1 Apr 2022 13:31:24 -0700 Subject: [PATCH 2/9] allow players who can access the chest to dig it --- init.lua | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/init.lua b/init.lua index cf9807d..45f2a90 100644 --- a/init.lua +++ b/init.lua @@ -164,7 +164,7 @@ chesttools.on_receive_fields = function(pos, formname, fields, player) selected = 'main'; end local inv_list = 'main'; - if( selected == 'main' ) then + if( selected == 'main' ) then inv_list = 'main'; elseif( selected == 'craft' ) then inv_list = 'craft'; @@ -431,7 +431,7 @@ chesttools.form_input_handler = function( player, formname, fields) chesttools.update_chest( pos, formname, fields, player); return true; -- this function was responsible for handling the input end - + return; end end @@ -469,10 +469,11 @@ minetest.register_node( 'chesttools:shared_chest', { "listring[current_player;main]") end, - can_dig = function(pos,player) - local meta = minetest.get_meta(pos); + can_dig = function(pos, player) + local player_name = (player and player.get_player_name and player:get_player_name()) or "" + local meta = minetest.get_meta(pos) local inv = meta:get_inventory() - return inv:is_empty("main") and player:get_player_name() == meta:get_string('owner'); + return player_name and inv:is_empty("main") and not minetest.is_protected(pos, player_name) end, allow_metadata_inventory_move = function(pos, from_list, from_index, @@ -573,7 +574,7 @@ minetest.register_node( 'chesttools:shared_chest', { formspec = 'size['..tostring(offset)..',6.5]'..formspec; -- only show the formspec if it really is a chest that can be updated if( can_be_upgraded ) then - minetest.show_formspec( name, "chesttools:update", formspec ); + minetest.show_formspec( name, "chesttools:update", formspec ); end return nil; end, From c851ab7e16dad2765b126511ef009b752b0da2bf Mon Sep 17 00:00:00 2001 From: flux <25628292+fluxionary@users.noreply.github.com> Date: Fri, 1 Apr 2022 13:39:49 -0700 Subject: [PATCH 3/9] fix crash (fixes #2) --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 45f2a90..f70f55b 100644 --- a/init.lua +++ b/init.lua @@ -90,7 +90,7 @@ end chesttools.may_use = function( pos, player ) - if( not( player )) then + if not (pos and player and player.is_player and player:is_player() and not player.is_fake_player) then return false; end local name = player:get_player_name(); From d335f5cf0343c1341777b2ea2485d96097ecb9f2 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Sun, 21 Aug 2022 21:07:38 +0200 Subject: [PATCH 4/9] prepared for colored chests (8 colors) --- init.lua | 28 ++++++++++++++++------- textures/chesttools_palette.png | Bin 0 -> 160 bytes textures/chesttools_white_chest_lock.png | Bin 0 -> 717 bytes textures/chesttools_white_chest_side.png | Bin 0 -> 538 bytes textures/chesttools_white_chest_top.png | Bin 0 -> 559 bytes 5 files changed, 20 insertions(+), 8 deletions(-) create mode 100644 textures/chesttools_palette.png create mode 100644 textures/chesttools_white_chest_lock.png create mode 100644 textures/chesttools_white_chest_side.png create mode 100644 textures/chesttools_white_chest_top.png diff --git a/init.lua b/init.lua index cf9807d..b127f79 100644 --- a/init.lua +++ b/init.lua @@ -33,8 +33,10 @@ chesttools.update_price = { chesttools.chest_add = {}; chesttools.chest_add.tiles = { - "chesttools_blue_chest_top.png", "chesttools_blue_chest_top.png", "chesttools_blue_chest_side.png", - "chesttools_blue_chest_side.png", "chesttools_blue_chest_side.png", "chesttools_blue_chest_lock.png"}; +-- "chesttools_blue_chest_top.png", "chesttools_blue_chest_top.png", "chesttools_blue_chest_side.png", +-- "chesttools_blue_chest_side.png", "chesttools_blue_chest_side.png", "chesttools_blue_chest_lock.png"}; + "chesttools_white_chest_top.png", "chesttools_white_chest_top.png", "chesttools_white_chest_side.png", + "chesttools_white_chest_side.png", "chesttools_white_chest_side.png", "chesttools_white_chest_lock.png"}; chesttools.chest_add.groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}; chesttools.chest_add.tube = {}; @@ -69,9 +71,11 @@ end chesttools.formspec = "size[9,10]".. "list[current_name;main;0.5,0.3;8,4;]".. - "label[0.0,9.7;Title/Content:]".. + "label[0.5,9.7;Name:]".. "field[1.8,10.0;6,0.5;chestname;;]".. - "button[7.5,9.7;1,0.5;set_chestname;Store]".. + "button[7.5,9.7;1,0.5;set_chestname;Store\nName]".. +-- "button[8.6,9.7;0.5,0.5;change_color;C]".. + "image_button[8.4,9.7;0.5,0.5;chesttools_palette.png;change_color;]".. "label[0.0,4.4;Main]".. "button[1.0,4.5;1,0.5;craft;Craft]".. "button[7.0,4.5;0.5,0.5;drop_all;DA]".. @@ -129,9 +133,11 @@ chesttools.on_receive_fields = function(pos, formname, fields, player) end local formspec = "size[9,10]".. - "label[0.0,9.7;Title/Content:]".. + "label[0.5,9.7;Name:]".. "field[1.8,10.0;6,0.5;chestname;;"..tostring( chestname or "unconfigured").."]".. - "button[7.5,9.7;1,0.5;set_chestname;Store]".. + "button[7.5,9.7;1,0.5;set_chestname;Store\nName]".. +-- "button[8.6,9.7;0.5,0.5;change_color;C]".. + "image_button[8.4,9.7;0.5,0.5;chesttools_palette.png;change_color;]".. "list[current_name;main;0.5,0.3;8,4;]".. "button[7.0,4.5;0.5,0.5;drop_all;DA]".. "button[7.5,4.5;0.5,0.5;take_all;TA]".. @@ -144,6 +150,11 @@ chesttools.on_receive_fields = function(pos, formname, fields, player) local b3 = "button[4.0,4.5;1,0.5;bag3;Bag 3]"; local b4 = "button[5.0,4.5;1,0.5;bag4;Bag 4]"; + if( fields.change_color ) then + local node = minetest.get_node( pos ) + minetest.swap_node(pos, {name=node.name, param2=(node.param2 + 32)}) + end + local selected = ''; if( fields.drop_all or fields.take_all or fields.swap_all or fields.filter_all ) then -- check if the player has sufficient access to the chest @@ -447,7 +458,8 @@ minetest.register_node( 'chesttools:shared_chest', { tiles = chesttools.chest_add.tiles, groups = chesttools.chest_add.groups, tube = chesttools.chest_add.tube, - paramtype2 = "facedir", + paramtype2 = "colorfacedir", + palette = "chesttools_palette.png", legacy_facedir_simple = true, is_ground_content = false, sounds = default.node_sound_wood_defaults(), @@ -472,7 +484,7 @@ minetest.register_node( 'chesttools:shared_chest', { can_dig = function(pos,player) local meta = minetest.get_meta(pos); local inv = meta:get_inventory() - return inv:is_empty("main") and player:get_player_name() == meta:get_string('owner'); + return inv:is_empty("main") and player and player:is_player() and player:get_player_name() == meta:get_string('owner'); end, allow_metadata_inventory_move = function(pos, from_list, from_index, diff --git a/textures/chesttools_palette.png b/textures/chesttools_palette.png new file mode 100644 index 0000000000000000000000000000000000000000..eab2dd110f8e84bdf4db4623e7e8db971a895792 GIT binary patch literal 160 zcmeAS@N?(olHy`uVBq!ia0vp^EI`b}!VDyP+Y$nRlth3}h${obij@ou1_lO;82%ql zVqlod@c%!<|Ie42ng9O;s$op>c6VXuV3qX%aySb-B8wRqxP?HN@zUM8KR`kD5>H=O z_J?dzyix)zS&;@nAwEwR#}JO|$pRe72IWi)OmPeklDKw%1YAX9X8WNB|8RBvx=!KdMT00075 zNklqGkYZ)6G!x+P0Fre4# z(Qda94-XG^adDB^*;xRTQUIiB`qvsDiXtvAFA*;>P07;T?czDRg#RUNK^YgS?EqvbxAP559-{0BV z+CubtJ=^d1ky4_yMhL;(-5m=H3lv2`mSxmxH9DOR^?Ds^EyLlE@$qq_l!&vlGh1di z#vr9+dwZLmogJp8rntSmrCP1hYPAT%5Un**N(O@g0OIxa)vm0p{OEqa-=|)$({8r` zSYBS{>gtMGt;TRTq*AHiI1Z<$r-`zD|8bY+IeUA1-x0zv{KKI9N!j3%e|fI8W`BPl@$~d$ zH#RnKUH8Yszo|6H^PJt?-ERtwMq@N-|DtkIJDtu?ga1(!MOYAX9X8WNB|8RBvx=!KdMT0004{ zNklK9cOc2} zdhl@X=}Et+@Bh21ngu~Xj^jWG0U-ncfH8(ztp)&4N5*y0k3oV_=%5Rh|}$1y~eCbi3WaIY*x7&~+V#VSq7)G)-X`2BefQO%qZ|5E1e` zN3+?4QVMLjToM4-wq2>z>viOLj>qEx&N-A)&@>HFN(dpqIY*XdPbcT|nfm?yud1+G zt-ub41C2%_bh}+Rj`L4}aUA1%y*>fQby8eVwK$!Z1V>MNbF&{hr3-FI0e;Ju07 zbMXxjh9UKOy&oOCg5o&-`w719)BS#jWm(X59YToe%eLEX2qB=90_Pk=gd|B|nkHJU c7K9M^19x5^n7$Lq_5c6?07*qoM6N<$f)hUKLI3~& literal 0 HcmV?d00001 diff --git a/textures/chesttools_white_chest_top.png b/textures/chesttools_white_chest_top.png new file mode 100644 index 0000000000000000000000000000000000000000..03f2f1de50a6d7826526b00ec4524d0bffae4b23 GIT binary patch literal 559 zcmV+~0?_@5P)YAX9X8WNB|8RBvx=!KdMT0005H zNklj$EA=4VviK?n@{fosyhr=Nu z1XPvZQdLq)q?7>g-s7A@RVj)B=Nw;OUpHVp9%HTLnNn5W-rg|FP8X4d;hR5ih>v;s>)2&*w8C x1gy1`Wm!*QyWQq`z2cn1IadR}^HNn6e*n+ULemV~%$5KE002ovPDHLkV1ixF{2~AV literal 0 HcmV?d00001 From 81b601b37466c457dbd2013569b659c3a89c9a78 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Wed, 24 Aug 2022 22:11:55 +0200 Subject: [PATCH 5/9] added colorwallmounted variant of chest --- init.lua | 64 ++++++++++++++++---- textures/chesttools_palette_wallmounted.png | Bin 0 -> 136 bytes 2 files changed, 53 insertions(+), 11 deletions(-) create mode 100644 textures/chesttools_palette_wallmounted.png diff --git a/init.lua b/init.lua index b127f79..bce7765 100644 --- a/init.lua +++ b/init.lua @@ -18,6 +18,7 @@ chesttools.update_price = { {'default:chest', 'default:steel_ingot', 0, 'normal', 1, 'nothing'}, {'default:chest_locked', 'default:steel_ingot', 1, 'locked', 2, 'steel ingot'}, {'chesttools:shared_chest', 'default:steel_ingot', 2, 'shared', 3, 'steel ingot(s)'}, + {'chesttools:shared_chest_wall', 'default:steel_ingot', 2, 'shared', 3, 'steel ingot(s)'}, {'locks:shared_locked_chest', 'default:steel_ingot', 3, 'locks', 4, 'steel ingot(s)'}, {'technic:iron_chest', 'technic:iron_chest', 1, 'iron', 5, 'Iron chest'}, {'technic:iron_locked_chest', 'technic:iron_locked_chest', 1, 'iron_locked', 6, 'Iron locked chest'}, @@ -118,10 +119,25 @@ chesttools.on_receive_fields = function(pos, formname, fields, player) return; end + if( fields.change_color ) then + local node = minetest.get_node( pos ) + local add = 0 + if(node and node.name and minetest.registered_nodes[node.name]) then + local def = minetest.registered_nodes[node.name] + if(def and def.paramtype2 == "colorfacedir") then + add = 32 + elseif(def and def.paramtype2 == "colorwallmounted") then + add = 8 + end + minetest.swap_node(pos, {name=node.name, param2=(node.param2 + add) % 256}) + return + end + end + local meta = minetest.get_meta( pos ); local chestname = meta:get_string( 'chestname' ); local spos = pos.x .. "," .. pos.y .. "," .. pos.z - if( fields.set_chestname and fields.chestname ) then + if( fields.set_chestname and fields.chestname and fields.chestname ~= chestname) then chestname = tostring( fields.chestname ); meta:set_string( 'chestname', chestname ); meta:set_string("infotext", "\""..chestname.."\" Chest (owned by "..meta:get_string("owner")..")") @@ -150,10 +166,6 @@ chesttools.on_receive_fields = function(pos, formname, fields, player) local b3 = "button[4.0,4.5;1,0.5;bag3;Bag 3]"; local b4 = "button[5.0,4.5;1,0.5;bag4;Bag 4]"; - if( fields.change_color ) then - local node = minetest.get_node( pos ) - minetest.swap_node(pos, {name=node.name, param2=(node.param2 + 32)}) - end local selected = ''; if( fields.drop_all or fields.take_all or fields.swap_all or fields.filter_all ) then @@ -452,14 +464,15 @@ end minetest.register_on_player_receive_fields( chesttools.form_input_handler ); -minetest.register_node( 'chesttools:shared_chest', { - description = 'Shared chest which can be used by all who can build at that spot', - name = 'shared chest', - tiles = chesttools.chest_add.tiles, +chesttools.register_chest = function(node_name, desc, name, paramtype2, palette, tiles) + minetest.register_node( node_name, { + description = desc, + name = name, + tiles = tiles, groups = chesttools.chest_add.groups, tube = chesttools.chest_add.tube, - paramtype2 = "colorfacedir", - palette = "chesttools_palette.png", + paramtype2 = paramtype2, + palette = palette, legacy_facedir_simple = true, is_ground_content = false, sounds = default.node_sound_wood_defaults(), @@ -590,9 +603,38 @@ minetest.register_node( 'chesttools:shared_chest', { return nil; end, }) +end + +chesttools.register_chest("chesttools:shared_chest", + 'Shared chest which can be used by all who can build at that spot', + 'shared chest', + 'colorfacedir', + 'chesttools_palette.png', + chesttools.chest_add.tiles) minetest.register_craft({ output = 'chesttools:shared_chest', type = 'shapeless', recipe = { 'default:steel_ingot', 'default:chest_locked' }, }) + +chesttools.register_chest("chesttools:shared_chest_wall", + 'Shared chest which can be used by all who can build at that spot (wallmounted)', + 'shared chest (wallmounted)', + 'colorwallmounted', + 'chesttools_palette_wallmounted.png', + {chesttools.chest_add.tiles[6], + chesttools.chest_add.tiles[3].."^[transformR180", + chesttools.chest_add.tiles[3].."^[transformR270", + chesttools.chest_add.tiles[3].."^[transformR90", + chesttools.chest_add.tiles[1].."^[transformR90", + chesttools.chest_add.tiles[1].."^[transformR90", + chesttools.chest_add.tiles[1], + }) + +minetest.register_craft({ + output = 'chesttools:shared_chest_wall', + type = 'shapeless', + recipe = { 'default:steel_ingot', 'chesttools:shared_chest' }, +}) + diff --git a/textures/chesttools_palette_wallmounted.png b/textures/chesttools_palette_wallmounted.png new file mode 100644 index 0000000000000000000000000000000000000000..8d3133b095ed7e13b16ab1cc2fa64f0043f59c07 GIT binary patch literal 136 zcmeAS@N?(olHy`uVBq!ia0vp^96-#%!2~32*1ud1r2IWy978y+s~+FT+n^xOcCr5f z7vBN3GmjarShN~Huxaz2)A(skefR3PxM?BTx=R_}-Mdx(=6UU2jw=%#SY$bKnJW?) lST@c%a6s(xfuIc=?Y%FaQ7m literal 0 HcmV?d00001 From 80d4ce0d84988413eec25879fc46380d0c1a56eb Mon Sep 17 00:00:00 2001 From: Sokomine Date: Wed, 24 Aug 2022 23:49:50 +0200 Subject: [PATCH 6/9] added right textures when pipeworks is installed --- init.lua | 12 ++++++------ textures/chesttools_blue_chest_front.png | Bin 0 -> 717 bytes textures/chesttools_blue_chest_lock.png | Bin 742 -> 0 bytes 3 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 textures/chesttools_blue_chest_front.png delete mode 100644 textures/chesttools_blue_chest_lock.png diff --git a/init.lua b/init.lua index bce7765..133ae2a 100644 --- a/init.lua +++ b/init.lua @@ -46,12 +46,12 @@ chesttools.chest_add.tube = {}; -- taken from pipeworks/compat.lua if( minetest.get_modpath( 'pipeworks' )) then chesttools.chest_add.tiles = { - "chesttools_blue_chest_top.png^pipeworks_tube_connection_wooden.png", - "chesttools_blue_chest_top.png^pipeworks_tube_connection_wooden.png", - "chesttools_blue_chest_side.png^pipeworks_tube_connection_wooden.png", - "chesttools_blue_chest_side.png^pipeworks_tube_connection_wooden.png", - "chesttools_blue_chest_side.png^pipeworks_tube_connection_wooden.png", - "chesttools_blue_chest_lock.png"}; + chesttools.chest_add.tiles[1].."^pipeworks_tube_connection_wooden.png", + chesttools.chest_add.tiles[1].."^pipeworks_tube_connection_wooden.png", + chesttools.chest_add.tiles[3].."^pipeworks_tube_connection_wooden.png", + chesttools.chest_add.tiles[3].."^pipeworks_tube_connection_wooden.png", + chesttools.chest_add.tiles[3].."^pipeworks_tube_connection_wooden.png", + chesttools.chest_add.tiles[6]}; chesttools.chest_add.groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, tubedevice = 1, tubedevice_receiver = 1 }; chesttools.chest_add.tube = { diff --git a/textures/chesttools_blue_chest_front.png b/textures/chesttools_blue_chest_front.png new file mode 100644 index 0000000000000000000000000000000000000000..359c7cfd68aa6296fa7868c52fd736ab0f6affe5 GIT binary patch literal 717 zcmV;;0y6!HP)YAX9X8WNB|8RBvx=!KdMT00075 zNklqGkYZ)6G!x+P0Fre4# z(Qda94-XG^adDB^*;xRTQUIiB`qvsDiXtvAFA*;>P07;T?czDRg#RUNK^YgS?EqvbxAP559-{0BV z+CubtJ=^d1ky4_yMhL;(-5m=H3lv2`mSxmxH9DOR^?Ds^EyLlE@$qq_l!&vlGh1di z#vr9+dwZLmogJp8rntSmrCP1hYPAT%5Un**N(O@g0OIxa)vm0p{OEqa-=|)$({8r` zSYBS{>gtMGt;TRTq*AHiI1Z<$r-`zD|8bY+IeUA1-x0zv{KKI9N!j3%e|fI8W`BPl@$~d$ zH#RnKUH8Yszo|6H^PJt?-ERtwMq@N-|DtkIJDtu?ga1(!MO^TA0WheU1TGSys;Z*&{e&nw4_w{&_%+Xt%%oqPBCrF9sF60XHxnY) zXx$4V(Kt^}=J8pUJ06_MiRk%GP^RqO!GRJ1`1Rpopv+9n#LQH2@-(vdzVF8?<;JiY zua;-;AMoAj#p$ECKjUw|e{p}tOXcdYv$j->2gO)KXtv*+9HqQ;DXP!tmmmLr^{q1^ zvREvJ!{HYn{Bhypc~zvSz2z*m=6}2M@bK`sTUDxBUiX zSbOL7eRZ?tBfD`-vdYUbGyQw9JenJbyxWc0$jZ`}7TUtd~Rg=h@y zBRL}S&iS(P0021l033%_7URJRlgr4NMF0W>4rZoe9BTz&CL$&p0l*xA)r2W)G=d~a z!{j`XiZLbg{s}ZdjJ3c07*qoM6N<$f Date: Thu, 25 Aug 2022 03:37:01 +0200 Subject: [PATCH 7/9] fixed crash --- init.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 133ae2a..437ae97 100644 --- a/init.lua +++ b/init.lua @@ -95,11 +95,14 @@ end chesttools.may_use = function( pos, player ) - if( not( player )) then + if( not( player ) or not(pos) or not(pos.x)) then return false; end local name = player:get_player_name(); local meta = minetest.get_meta( pos ); + if(not(meta)) then + return false + end local owner = meta:get_string( 'owner' ) -- the owner can access the chest if( owner == name or owner == "" ) then From 9289a1ae9d55bbc76cfa99316cac3821db86faa4 Mon Sep 17 00:00:00 2001 From: flux <25628292+fluxionary@users.noreply.github.com> Date: Wed, 21 Dec 2022 10:06:11 -0800 Subject: [PATCH 8/9] set infotext after swapping node --- init.lua | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/init.lua b/init.lua index cf9807d..4de9183 100644 --- a/init.lua +++ b/init.lua @@ -362,17 +362,6 @@ chesttools.update_chest = function(pos, formname, fields, player) player_inv:add_item( 'main', old_price_item..' '..tostring(old_price_amount)); end - -- set the owner field - meta:set_string( 'owner', pname ); - - if( fields.locked ) then - meta:set_string("infotext", "Locked Chest (owned by "..meta:get_string("owner")..")") - elseif( fields.shared ) then - meta:set_string("infotext", "Shared Chest (owned by "..meta:get_string("owner")..")") - else - meta:set_string("infotext", "Chest") - end - -- copy the old inventory local inv = meta:get_inventory(); local main_inv = {}; @@ -387,6 +376,14 @@ chesttools.update_chest = function(pos, formname, fields, player) -- make sure the player owns the new chest meta:set_string("owner", pname); + if( fields.locked ) then + meta:set_string("infotext", "Locked Chest (owned by "..pname..")") + elseif( fields.shared ) then + meta:set_string("infotext", "Shared Chest (owned by "..pname..")") + else + meta:set_string("infotext", "Chest") + end + -- put the inventory back local new_inv = meta:get_inventory(); local new_inv_size = inv:get_size("main"); From 470774008a106e52a2a09171f9a7e79c215d8ec7 Mon Sep 17 00:00:00 2001 From: flux <25628292+fluxionary@users.noreply.github.com> Date: Sat, 31 Dec 2022 09:27:35 -0800 Subject: [PATCH 9/9] trigger pipeworks visual connection when placing a shared chest next to a pipe --- init.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index cf9807d..c35ca22 100644 --- a/init.lua +++ b/init.lua @@ -41,7 +41,8 @@ chesttools.chest_add.tube = {}; -- additional/changed definitions for pipeworks; -- taken from pipeworks/compat.lua -if( minetest.get_modpath( 'pipeworks' )) then +local has_pipeworks = minetest.get_modpath( 'pipeworks' ) +if( has_pipeworks ) then chesttools.chest_add.tiles = { "chesttools_blue_chest_top.png^pipeworks_tube_connection_wooden.png", "chesttools_blue_chest_top.png^pipeworks_tube_connection_wooden.png", @@ -456,6 +457,9 @@ minetest.register_node( 'chesttools:shared_chest', { local meta = minetest.get_meta(pos) meta:set_string("owner", placer:get_player_name() or "") meta:set_string("infotext", "Shared Chest (owned by "..meta:get_string("owner")..")") + if has_pipeworks then + pipeworks.after_place(pos) + end end, on_construct = function(pos)