Yatopia/patches/server/0048-Allow-to-change-the-piston-push-limit.patch
2020-03-29 00:36:07 +01:00

60 lines
2.2 KiB
Diff

From c0dee25cb5a73000db0dbea2fd43f7ee368e1a5f Mon Sep 17 00:00:00 2001
From: tr7zw <tr7zw@live.de>
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 655c4e68f..29587589c 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 8ac7d30be..de1c98cca 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