From b80888f31bf792b7a9e69f725e08d330fc64c04e Mon Sep 17 00:00:00 2001 From: tr7zw Date: Sun, 29 Mar 2020 00:35:03 +0100 Subject: [PATCH] Allow to change the piston push limit --- src/main/java/de/tr7zw/yapfa/YapfaConfig.java | 4 ++++ .../java/net/minecraft/server/PistonExtendsChecker.java | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/tr7zw/yapfa/YapfaConfig.java b/src/main/java/de/tr7zw/yapfa/YapfaConfig.java index 655c4e68f3..29587589cb 100644 --- a/src/main/java/de/tr7zw/yapfa/YapfaConfig.java +++ b/src/main/java/de/tr7zw/yapfa/YapfaConfig.java @@ -221,5 +221,9 @@ public class YapfaConfig { onlyPlayerCollisions = getBoolean("settings.onlyPlayerCollisions", false); } + public static int pistonPushLimit = 12; + private static void pistonPushLimit() { + pistonPushLimit = getInt("settings.pistonPushLimit", 12); + } } \ No newline at end of file diff --git a/src/main/java/net/minecraft/server/PistonExtendsChecker.java b/src/main/java/net/minecraft/server/PistonExtendsChecker.java index 8ac7d30bea..de1c98ccab 100644 --- a/src/main/java/net/minecraft/server/PistonExtendsChecker.java +++ b/src/main/java/net/minecraft/server/PistonExtendsChecker.java @@ -79,7 +79,7 @@ public class PistonExtendsChecker { } else { int i = 1; - if (i + this.f.size() > 12) { + if (i + this.f.size() > de.tr7zw.yapfa.YapfaConfig.pistonPushLimit) { // YAPFA return false; } else { while (a(block)) { @@ -93,7 +93,7 @@ public class PistonExtendsChecker { } ++i; - if (i + this.f.size() > 12) { + if (i + this.f.size() > de.tr7zw.yapfa.YapfaConfig.pistonPushLimit) { // YAPFA return false; } } @@ -141,7 +141,7 @@ public class PistonExtendsChecker { return true; } - if (this.f.size() >= 12) { + if (this.f.size() >= de.tr7zw.yapfa.YapfaConfig.pistonPushLimit) { // YAPFA return false; } -- 2.25.1.windows.1