From 0000000000000000000000000000000000000000 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 diff --git a/src/main/java/de/tr7zw/yapfa/YapfaConfig.java b/src/main/java/de/tr7zw/yapfa/YapfaConfig.java index 071e9f9a5447c7ff4fb15d9c5a6fced4c22739b7..716b2dea9b6e8d9d446e0e793b1c6f9ec16816ab 100644 --- a/src/main/java/de/tr7zw/yapfa/YapfaConfig.java +++ b/src/main/java/de/tr7zw/yapfa/YapfaConfig.java @@ -211,5 +211,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 95aeaaf0bb07c5ecf7117dae3382b0f0aac6426f..dd64aad1ed6c2acf360e757bf0369da5fcf6be41 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; }