summaryrefslogtreecommitdiff
path: root/sorting_tubes.lua
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2016-08-30 14:13:01 -0400
committerGitHub <noreply@github.com>2016-08-30 14:13:01 -0400
commit6e0e7c47d08225b8483540229ccb900a24cf4aed (patch)
tree35b6b14e3f1e0c08f1489ac5422d1875fa03d7c7 /sorting_tubes.lua
parenta1ed3acd7a7b65825b2faba4cc81dd42b249ba44 (diff)
parent4fdf73fbcd992786cdbb60431e739cdcfc2362a2 (diff)
downloadpipeworks-6e0e7c47d08225b8483540229ccb900a24cf4aed.tar
pipeworks-6e0e7c47d08225b8483540229ccb900a24cf4aed.tar.gz
pipeworks-6e0e7c47d08225b8483540229ccb900a24cf4aed.tar.bz2
pipeworks-6e0e7c47d08225b8483540229ccb900a24cf4aed.tar.xz
pipeworks-6e0e7c47d08225b8483540229ccb900a24cf4aed.zip
Merge pull request #150 from t4im/master
Add list rings and enable sorting tube reordering
Diffstat (limited to 'sorting_tubes.lua')
-rw-r--r--sorting_tubes.lua25
1 files changed, 22 insertions, 3 deletions
diff --git a/sorting_tubes.lua b/sorting_tubes.lua
index 6d432ae..edaa24a 100644
--- a/sorting_tubes.lua
+++ b/sorting_tubes.lua
@@ -31,7 +31,21 @@ if pipeworks.enable_mese_tube then
"image[0,4;1,1;pipeworks_blue.png]"..
"image[0,5;1,1;pipeworks_red.png]"..
buttons_formspec..
- "list[current_player;main;0,7;8,4;]")
+ "list[current_player;main;0,7;8,4;]" ..
+ "listring[current_player;main]" ..
+ "listring[current_player;main]" ..
+ "listring[context;line1]" ..
+ "listring[current_player;main]" ..
+ "listring[context;line2]" ..
+ "listring[current_player;main]" ..
+ "listring[context;line3]" ..
+ "listring[current_player;main]" ..
+ "listring[context;line4]" ..
+ "listring[current_player;main]" ..
+ "listring[context;line5]" ..
+ "listring[current_player;main]" ..
+ "listring[context;line6]"
+ )
end
pipeworks.register_tube("pipeworks:mese_tube", {
@@ -119,8 +133,13 @@ if pipeworks.enable_mese_tube then
if not pipeworks.may_configure(pos, player) then return 0 end
update_formspec(pos) -- For old tubes
local inv = minetest.get_meta(pos):get_inventory()
- inv:set_stack(from_list, from_index, ItemStack(""))
- return 0
+
+ if from_list:match("line%d") and to_list:match("line%d") then
+ return count
+ else
+ inv:set_stack(from_list, from_index, ItemStack(""))
+ return 0
+ end
end,
},
})