From 33c4c9d552c7f113a21405456e67c0e4752674a8 Mon Sep 17 00:00:00 2001 From: Novatux Date: Wed, 5 Apr 2017 02:57:22 -0400 Subject: let tubes break if they're "over-pressure" that is, if there are more than X number of items in a tube. Default is 40 in a tube, but breaking is also disabled by default. (original framework by Novatux, with changes by VanessaE) --- routing_tubes.lua | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'routing_tubes.lua') diff --git a/routing_tubes.lua b/routing_tubes.lua index f415c3e..fa5cefe 100644 --- a/routing_tubes.lua +++ b/routing_tubes.lua @@ -1,3 +1,4 @@ + -- the default tube and default textures pipeworks.register_tube("pipeworks:tube", "Pneumatic tube segment") minetest.register_craft( { @@ -9,6 +10,28 @@ minetest.register_craft( { }, }) +pipeworks.register_tube("pipeworks:broken_tube", { + description = "Broken Tube (you hacker you)", + plain = { { name = "pipeworks_broken_tube_plain.png", backface_culling = false, color = nodecolor } }, + noctr = { { name = "pipeworks_broken_tube_plain.png", backface_culling = false, color = nodecolor } }, + ends = { { name = "pipeworks_broken_tube_end.png", color = nodecolor } }, + short = { name = "pipeworks_broken_tube_short.png", color = nodecolor }, + node_def = { + drop = "pipeworks:tube_1", + groups = {not_in_creative_inventory = 1, tubedevice_receiver = 1}, + tube = { + insert_object = function(pos, node, stack, direction) + minetest.item_drop(stack, nil, pos) + return ItemStack("") + end, + can_insert = function(pos,node,stack,direction) + return true + end, + priority = 50, + } + } +}) + -- the high priority tube is a low-cpu replacement for sorting tubes in situations -- where players would use them for simple routing (turning off paths) -- without doing actual sorting, like at outputs of tubedevices that might both accept and eject items -- cgit v1.2.3