diff --git a/default_settings.lua b/default_settings.lua index 99b86fe..f027461 100644 --- a/default_settings.lua +++ b/default_settings.lua @@ -15,6 +15,7 @@ local settings = { enable_detector_tube = true, enable_digiline_detector_tube = true, enable_conductor_tube = true, + enable_digiline_conductor_tube = true, enable_accelerator_tube = true, enable_crossing_tube = true, enable_sand_tube = true, diff --git a/init.lua b/init.lua index a3f31c7..1a330e5 100644 --- a/init.lua +++ b/init.lua @@ -38,6 +38,7 @@ pipeworks.rules_all = {{x=0, y=0, z=1},{x=0, y=0, z=-1},{x=1, y=0, z=0},{x=-1, y {x=0, y=1, z=0}, {x=0, y=-1, z=0}} pipeworks.mesecons_rules={{x=0,y=0,z=1},{x=0,y=0,z=-1},{x=1,y=0,z=0},{x=-1,y=0,z=0},{x=0,y=1,z=0},{x=0,y=-1,z=0}} +pipeworks.digilines_rules={{x=0,y=0,z=1},{x=0,y=0,z=-1},{x=1,y=0,z=0},{x=-1,y=0,z=0},{x=0,y=1,z=0},{x=0,y=-1,z=0}} pipeworks.liquid_texture = "default_water.png" diff --git a/settingtypes.txt b/settingtypes.txt index 1d3c10c..5086bcf 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -34,6 +34,9 @@ pipeworks_enable_digiline_detector_tube (Enable Digiline Detector Tube) bool tru #Enable mesecon signal conducting tube. pipeworks_enable_conductor_tube (Enable Conductor Tube) bool true +#Enable digiline signal conducting tube. +pipeworks_enable_digiline_conductor_tube (Enable Digiline Conductor Tube) bool true + #Enable accelerator tube. pipeworks_enable_accelerator_tube (Enable Accelerator Tube) bool true @@ -67,4 +70,4 @@ pipeworks_enable_cyclic_mode (Enable Cyclic Mode) bool true pipeworks_drop_on_routing_fail (Drop On Routing Fail) bool false #Delete item on clearobject. -pipeworks_delete_item_on_clearobject (Delete Item On Clearobject) bool true \ No newline at end of file +pipeworks_delete_item_on_clearobject (Delete Item On Clearobject) bool true diff --git a/signal_tubes.lua b/signal_tubes.lua index a0a8039..b955a16 100644 --- a/signal_tubes.lua +++ b/signal_tubes.lua @@ -67,7 +67,8 @@ if pipeworks.enable_detector_tube then }) end -if minetest.get_modpath("digilines") and pipeworks.enable_digiline_detector_tube then +local digiline_enabled = minetest.get_modpath("digilines") ~= nil +if digiline_enabled and pipeworks.enable_digiline_detector_tube then pipeworks.register_tube("pipeworks:digiline_detector_tube", { description = "Digiline Detecting Pneumatic Tube Segment", inventory_image = "pipeworks_digiline_detector_tube_inv.png", @@ -147,14 +148,80 @@ if pipeworks.enable_conductor_tube then }, }) - minetest.register_craft( { - output = "pipeworks:conductor_tube_off_1 6", - recipe = { - { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" }, - { "mesecons:mesecon", "mesecons:mesecon", "mesecons:mesecon" }, - { "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting" } - }, + minetest.register_craft({ + type = "shapeless", + output = "pipeworks:conductor_tube_off_1", + recipe = {"pipeworks:tube_1", "mesecons:mesecon"} }) end +if digiline_enabled and pipeworks.enable_digiline_conductor_tube then + pipeworks.register_tube("pipeworks:digiline_conductor_tube", { + description = "Digiline Conducting Pneumatic Tube Segment", + inventory_image = "pipeworks_tube_inv.png^pipeworks_digiline_conductor_tube_inv.png", + short = "pipeworks_tube_short.png^pipeworks_digiline_conductor_tube_short.png", + plain = {"pipeworks_tube_plain.png^pipeworks_digiline_conductor_tube_plain.png"}, + noctr = {"pipeworks_tube_noctr.png^pipeworks_digiline_conductor_tube_noctr.png"}, + ends = {"pipeworks_tube_end.png^pipeworks_digiline_conductor_tube_end.png"}, + node_def = {digiline = {wire = {rules = pipeworks.digilines_rules}}}, + }) + minetest.register_craft({ + type = "shapeless", + output = "pipeworks:digiline_conductor_tube_1", + recipe = {"pipeworks:tube_1", "digilines:wire_std_00000000"} + }) +end +if digiline_enabled and pipeworks.enable_digiline_conductor_tube and + pipeworks.enable_conductor_tube then + pipeworks.register_tube("pipeworks:mesecon_and_digiline_conductor_tube_off", { + description = "Mesecon and Digiline Conducting Pneumatic Tube Segment", + inventory_image = "pipeworks_conductor_tube_inv.png^pipeworks_digiline_conductor_tube_inv.png", + short = "pipeworks_conductor_tube_short.png^pipeworks_digiline_conductor_tube_short.png", + plain = {"pipeworks_conductor_tube_plain.png^pipeworks_digiline_conductor_tube_plain.png"}, + noctr = {"pipeworks_conductor_tube_noctr.png^pipeworks_digiline_conductor_tube_noctr.png"}, + ends = {"pipeworks_conductor_tube_end.png^pipeworks_digiline_conductor_tube_end.png"}, + node_def = { + digiline = {wire = {rules = pipeworks.digilines_rules}}, + groups = {mesecon = 2}, + mesecons = {conductor = { + state = "off", + rules = pipeworks.mesecons_rules, + onstate = "pipeworks:mesecon_and_digiline_conductor_tube_on_#id" + }}, + }, + }) + pipeworks.register_tube("pipeworks:mesecon_and_digiline_conductor_tube_on", { + description = "Mesecon and Digiline Conducting Pneumatic Tube Segment on (you hacker you)", + inventory_image = "pipeworks_conductor_tube_inv.png^pipeworks_digiline_conductor_tube_inv.png", + short = "pipeworks_conductor_tube_short.png^pipeworks_digiline_conductor_tube_short.png", + plain = {"pipeworks_conductor_tube_on_plain.png^pipeworks_digiline_conductor_tube_plain.png"}, + noctr = {"pipeworks_conductor_tube_on_noctr.png^pipeworks_digiline_conductor_tube_noctr.png"}, + ends = {"pipeworks_conductor_tube_on_end.png^pipeworks_digiline_conductor_tube_end.png"}, + node_def = { + digiline = {wire = {rules = pipeworks.digilines_rules}}, + groups = {mesecon = 2, not_in_creative_inventory = 1}, + drop = "pipeworks:mesecon_and_digiline_conductor_tube_off_1", + mesecons = {conductor = { + state = "on", + rules = pipeworks.mesecons_rules, + offstate = "pipeworks:mesecon_and_digiline_conductor_tube_off_#id"} + }, + }, + }) + minetest.register_craft({ + type = "shapeless", + output = "pipeworks:mesecon_and_digiline_conductor_tube_off_1", + recipe = {"pipeworks:tube_1", "mesecons:mesecon", "digilines:wire_std_00000000"} + }) + minetest.register_craft({ + type = "shapeless", + output = "pipeworks:mesecon_and_digiline_conductor_tube_off_1", + recipe = {"pipeworks:conductor_tube_off_1", "digilines:wire_std_00000000"} + }) + minetest.register_craft({ + type = "shapeless", + output = "pipeworks:mesecon_and_digiline_conductor_tube_off_1", + recipe = {"pipeworks:digiline_conductor_tube_1", "mesecons:mesecon"} + }) +end diff --git a/textures/pipeworks_digiline_conductor_tube_end.png b/textures/pipeworks_digiline_conductor_tube_end.png new file mode 100644 index 0000000..e6c2cfc Binary files /dev/null and b/textures/pipeworks_digiline_conductor_tube_end.png differ diff --git a/textures/pipeworks_digiline_conductor_tube_inv.png b/textures/pipeworks_digiline_conductor_tube_inv.png new file mode 100644 index 0000000..7f23c8c Binary files /dev/null and b/textures/pipeworks_digiline_conductor_tube_inv.png differ diff --git a/textures/pipeworks_digiline_conductor_tube_noctr.png b/textures/pipeworks_digiline_conductor_tube_noctr.png new file mode 100644 index 0000000..b58a4d3 Binary files /dev/null and b/textures/pipeworks_digiline_conductor_tube_noctr.png differ diff --git a/textures/pipeworks_digiline_conductor_tube_plain.png b/textures/pipeworks_digiline_conductor_tube_plain.png new file mode 100644 index 0000000..de31307 Binary files /dev/null and b/textures/pipeworks_digiline_conductor_tube_plain.png differ diff --git a/textures/pipeworks_digiline_conductor_tube_short.png b/textures/pipeworks_digiline_conductor_tube_short.png new file mode 100644 index 0000000..6108485 Binary files /dev/null and b/textures/pipeworks_digiline_conductor_tube_short.png differ