From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: tr7zw Date: Fri, 31 Jul 2020 21:28:00 -0500 Subject: [PATCH] Allow to change the piston push limit diff --git a/src/main/java/net/minecraft/world/level/block/piston/PistonExtendsChecker.java b/src/main/java/net/minecraft/world/level/block/piston/PistonExtendsChecker.java index 6c9c4ab65b7e42efa68027057242e25b70313081..fe1612a8210fcd42c901d0cf3ec7fe6cfea9ff1b 100644 --- a/src/main/java/net/minecraft/world/level/block/piston/PistonExtendsChecker.java +++ b/src/main/java/net/minecraft/world/level/block/piston/PistonExtendsChecker.java @@ -86,7 +86,7 @@ public class PistonExtendsChecker { } else { int i = 1; - if (i + this.f.size() > 12) { + if (i + this.f.size() > org.yatopiamc.yatopia.server.YatopiaConfig.pistonPushLimit) { // Yatopia return false; } else { while (a(block)) { @@ -100,7 +100,7 @@ public class PistonExtendsChecker { } ++i; - if (i + this.f.size() > 12) { + if (i + this.f.size() > org.yatopiamc.yatopia.server.YatopiaConfig.pistonPushLimit) { // Yatopia return false; } } @@ -148,7 +148,7 @@ public class PistonExtendsChecker { return true; } - if (this.f.size() >= 12) { + if (this.f.size() >= org.yatopiamc.yatopia.server.YatopiaConfig.pistonPushLimit) { // Yatopia return false; } diff --git a/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java b/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java index f5a43e607f9c13e07a0f5e7e139eed93f159185b..415f7def834399ab94edc380b8201058b424fe45 100644 --- a/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java +++ b/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java @@ -189,4 +189,9 @@ public class YatopiaConfig { private static void brandName() { brandName = getString("brand-name", brandName); } + + public static int pistonPushLimit = 12; + private static void pistonPushLimit() { + pistonPushLimit = getInt("settings.pistonPushLimit", 12); + } }