Files
Purpur/patches/server/0205-Allows-you-to-change-the-thrust-limit-of-a-piston-by.patch

61 lines
2.8 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: DoctaEnkoda <bierquejason@gmail.com>
Date: Sun, 2 May 2021 23:14:54 +0200
Subject: [PATCH] Allows you to change the thrust limit of a piston by World
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..cbe34059659e0f80ff384508b01e516cd7c5e28a 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
@@ -12,7 +12,7 @@ import net.minecraft.world.level.material.EnumPistonReaction;
public class PistonExtendsChecker {
- private final World a;
+ private final World a; public World getWorld() { return a; } // Purpur - OBFHELPER
private final BlockPosition b;
private final boolean c;
private final BlockPosition d;
@@ -86,7 +86,7 @@ public class PistonExtendsChecker {
} else {
int i = 1;
- if (i + this.f.size() > 12) {
+ if (i + this.f.size() > this.getWorld().purpurConfig.pistonBlockPushLimit) { // Purpur
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() > this.getWorld().purpurConfig.pistonBlockPushLimit) { // Purpur
return false;
}
}
@@ -148,7 +148,7 @@ public class PistonExtendsChecker {
return true;
}
- if (this.f.size() >= 12) {
+ if (this.f.size() >= this.getWorld().purpurConfig.pistonBlockPushLimit) { // Purpur
return false;
}
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 63a1b0f569c8f034e7577c304ec23a7a96c666f7..a08bf2a374a486cf44128a87667567df65329e0c 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -2157,4 +2157,9 @@ public class PurpurWorldConfig {
magmaBlockDamageWhenSneaking = getBoolean("blocks.magma-block.damage-when-sneaking", magmaBlockDamageWhenSneaking);
magmaBlockDamageWithFrostWalker = getBoolean("blocks.magma-block.damage-with-frost-walker", magmaBlockDamageWithFrostWalker);
}
+
+ public int pistonBlockPushLimit = 12;
+ private void pistonSettings() {
+ pistonBlockPushLimit = getInt("blocks.piston.block-push-limit", pistonBlockPushLimit);
+ }
}