From b62075afcb79bb46ce78d947f278e5b081f94e03 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 22 Jan 2018 17:33:06 +0100 Subject: [PATCH] Fix rail rules (kinda) --- mods/ENTITIES/mcl_minecarts/rails.lua | 33 +++++++++++++++++++++------ 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/mods/ENTITIES/mcl_minecarts/rails.lua b/mods/ENTITIES/mcl_minecarts/rails.lua index a5be21c7..c1bf3c13 100644 --- a/mods/ENTITIES/mcl_minecarts/rails.lua +++ b/mods/ENTITIES/mcl_minecarts/rails.lua @@ -30,6 +30,26 @@ local register_rail = function(itemstring, tiles, def_extras, creative) minetest.register_node(itemstring, ndef) end +-- Redstone rules +local rail_rules_long = +{{x=-1, y= 0, z= 0, spread=true}, + {x= 1, y= 0, z= 0, spread=true}, + {x= 0, y=-1, z= 0, spread=true}, + {x= 0, y= 1, z= 0, spread=true}, + {x= 0, y= 0, z=-1, spread=true}, + {x= 0, y= 0, z= 1, spread=true}, + + {x= 1, y= 1, z= 0}, + {x= 1, y=-1, z= 0}, + {x=-1, y= 1, z= 0}, + {x=-1, y=-1, z= 0}, + {x= 0, y= 1, z= 1}, + {x= 0, y=-1, z= 1}, + {x= 0, y= 1, z=-1}, + {x= 0, y=-1, z=-1}} + +local rail_rules_short = mesecon.rules.pplate + local railuse = "Place them on the ground to build your railway, the rails will automatically connect to each other and will turn into curves, T-junctions, crossings and slopes as needed." -- Normal rail @@ -55,7 +75,7 @@ register_rail("mcl_minecarts:golden_rail", state = mesecon.state.off, offstate = "mcl_minecarts:golden_rail", onstate = "mcl_minecarts:golden_rail_on", - rules = mesecon.rules.default, + rules = rail_rules_long, }, }, } @@ -72,7 +92,7 @@ register_rail("mcl_minecarts:golden_rail_on", state = mesecon.state.on, offstate = "mcl_minecarts:golden_rail", onstate = "mcl_minecarts:golden_rail_on", - rules = mesecon.rules.default, + rules = rail_rules_long, }, }, drop = "mcl_minecarts:golden_rail", @@ -80,7 +100,6 @@ register_rail("mcl_minecarts:golden_rail_on", false ) - -- Activator rail (off) register_rail("mcl_minecarts:activator_rail", {"mcl_minecarts_rail_activator.png", "default_rail_curved.png^[colorize:#FF0000:96", "default_rail_t_junction.png^[colorize:#FF0000:96", "default_rail_crossing.png^[colorize:#FF0000:96"}, @@ -93,7 +112,7 @@ register_rail("mcl_minecarts:activator_rail", state = mesecon.state.off, offstate = "mcl_minecarts:activator_rail", onstate = "mcl_minecarts:activator_rail_on", - rules = mesecon.rules.default, + rules = rail_rules_long, }, }, } @@ -109,7 +128,7 @@ register_rail("mcl_minecarts:activator_rail_on", state = mesecon.state.on, offstate = "mcl_minecarts:activator_rail", onstate = "mcl_minecarts:activator_rail_on", - rules = mesecon.rules.default, + rules = rail_rules_long, }, }, drop = "mcl_minecarts:activator_rail", @@ -127,7 +146,7 @@ register_rail("mcl_minecarts:detector_rail", mesecons = { receptor = { state = mesecon.state.off, - rules = mesecon.rules.pplate, + rules = rail_rules_short, }, }, } @@ -141,7 +160,7 @@ register_rail("mcl_minecarts:detector_rail_on", mesecons = { receptor = { state = mesecon.state.on, - rules = mesecon.rules.pplate, + rules = rail_rules_short, }, }, drop = "mcl_minecarts:detector_rail",