Skip to content

Commit

Permalink
Fixes Issue #64 (#142)
Browse files Browse the repository at this point in the history
* Fixes Issue #64

Uses a simple boolean setting in default_settings.lua to decide which digiline rules to use in common.lua

* Reviewer Suggestion

Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com>

* Changed Code Comment per Reviewer Suggestion

* Removed trailing whitespace from 2 comment lines.

* Modified settings comment per reviewer suggestion

* Changed variable name per reviewer suggestion.

Variable changed from use_default_digilines_rules to enable_vertical_digilines_connectivity.

---------

Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com>
  • Loading branch information
Deathwing777 and S-S-X authored Nov 4, 2024
1 parent 222a865 commit dcc62eb
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
12 changes: 11 additions & 1 deletion common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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.enable_vertical_digilines_connectivity then
pipeworks.digilines_rules=digiline.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
Expand Down
1 change: 1 addition & 0 deletions default_settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ local settings = {
delete_item_on_clearobject = true,
use_real_entities = true,
entity_update_interval = 0,
enable_vertical_digilines_connectivity = true,
}

pipeworks.toggles = {}
Expand Down
9 changes: 9 additions & 0 deletions settingtypes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@ 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 the following devices will connect to digiline networks in the vertical direction:
# digiline filter injector, deployer, dispenser, node breaker, autocrafter
# If disabled, the devices will not be able to send or recieve digiline signals from the top
# or bottom faces, regardless of the node rotation. This breaks expected behavior with digiline
# conducting tubes, so it is recommended to enable this option unless you have specific builds
# that make use of the lack of vertical digiline connectivity and those are more important to you.
enable_vertical_digilines_connectivity (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

Expand Down

0 comments on commit dcc62eb

Please sign in to comment.