mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-22 02:47:43 +01:00
61 lines
2.8 KiB
Diff
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 e082de2fdbd4803f5c79699b813062291f8e2bb7..07c66f9d41e7a74021dde6702d654710e400e93b 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -2155,4 +2155,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);
|
|
+ }
|
|
}
|