From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Encode42 <me@encode42.dev>
Date: Thu, 25 Mar 2021 18:10:03 -0400
Subject: [PATCH] Config for powered rail activation distance


diff --git a/src/main/java/net/minecraft/world/level/block/BlockPoweredRail.java b/src/main/java/net/minecraft/world/level/block/BlockPoweredRail.java
index b26e168fbf49bbe7ec981b5b186c94ca67827f4a..bc91c96a29dcc60c578b342055b8eaf3e620a81d 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockPoweredRail.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockPoweredRail.java
@@ -24,7 +24,7 @@ public class BlockPoweredRail extends BlockMinecartTrackAbstract {
     }
 
     protected boolean a(World world, BlockPosition blockposition, IBlockData iblockdata, boolean flag, int i) {
-        if (i >= 8) {
+        if (i >= world.purpurConfig.railActivationRange) { // Purpur
             return false;
         } else {
             int j = blockposition.getX();
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index adbb934ce58a0ece9839d35369f830e4028c197c..a3cca259f03d6ee0551bd075ceaa91ffb8fa21fc 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -539,6 +539,11 @@ public class PurpurWorldConfig {
         lavaSpeedNotNether = getInt("blocks.lava.speed.not-nether", lavaSpeedNotNether);
     }
 
+    public int railActivationRange = 8;
+    private void railSettings() {
+        railActivationRange = getInt("blocks.powered-rail.activation-range", railActivationRange);
+    }
+
     public boolean respawnAnchorExplode = true;
     public double respawnAnchorExplosionPower = 5.0D;
     public boolean respawnAnchorExplosionFire = true;
