From c2f3069f7c13245bd51038b3bde8d3b3a3a5e3b0 Mon Sep 17 00:00:00 2001 From: Deathwing777 <160651137+Deathwing777@users.noreply.github.com> Date: Sun, 20 Oct 2024 13:26:39 -0700 Subject: [PATCH] Fixes Issue #64 Uses a simple boolean setting in default_settings.lua to decide which digiline rules to use in common.lua --- common.lua | 12 +++++++++++- default_settings.lua | 1 + settingtypes.txt | 5 +++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/common.lua b/common.lua index dcf2c7f..d748c83 100644 --- a/common.lua +++ b/common.lua @@ -15,7 +15,17 @@ 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}} + +local digilines_enabled = minetest.get_modpath("digilines") ~= nil +if digilines_enabled and pipeworks.use_default_digilines_rules then + pipeworks.digilines_rules=digilines.rules.default +else + -- These rules break vertical connectivity to deployers, node breakers, dispensers, and digiline filter injectors + -- via digiline conducting tubes. Changing them may break some builds on some servers, so the setting was added + -- for server admins to be able to revert to the old "broken" behavior as some builds may use it as a "feature". + -- See https://github.com/mt-mods/pipeworks/issues/64 + 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}} +end pipeworks.liquid_texture = minetest.registered_nodes[pipeworks.liquids.water.flowing].tiles[1] if type(pipeworks.liquid_texture) == "table" then pipeworks.liquid_texture = pipeworks.liquid_texture.name end diff --git a/default_settings.lua b/default_settings.lua index c48d852..c4edf44 100644 --- a/default_settings.lua +++ b/default_settings.lua @@ -31,6 +31,7 @@ local settings = { delete_item_on_clearobject = true, use_real_entities = true, entity_update_interval = 0, + use_default_digilines_rules = true, } pipeworks.toggles = {} diff --git a/settingtypes.txt b/settingtypes.txt index 8508892..013ffd6 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -85,6 +85,11 @@ pipeworks_use_real_entities (Use Real Entities) bool true #A value 0.2 or above may cause issues with accelerator tubes. pipeworks_entity_update_interval (Entity Update Interval) float 0 0 0.8 +# Use the default rules from the digilines mod. +# If enabled pipeworks devices (filter injector, deployer, dispenser, node breaker, +# teleport tube, lua tube, etc) will conduct digiline signals vertically. +pipeworks_use_default_digilines_rules (Use the default rules from the digilines mod) bool true + # if set to true, items passing through teleport tubes will log log where they came from and where they went. pipeworks_log_teleport_tubes (Log Teleport Tubes) bool false