mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-22 08:29:28 +00:00
55 lines
2.6 KiB
Diff
55 lines
2.6 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] Purpur: Configurable piston push limit
|
|
|
|
Original license: MIT
|
|
Original project: https://github.com/PurpurMC/Purpur
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/block/piston/PistonStructureResolver.java b/src/main/java/net/minecraft/world/level/block/piston/PistonStructureResolver.java
|
|
index 744d91546d1a810f60a43c15ed74b4158f341a4a..460609a50d0f68c191f0fd529a7dc582ac0a2317 100644
|
|
--- a/src/main/java/net/minecraft/world/level/block/piston/PistonStructureResolver.java
|
|
+++ b/src/main/java/net/minecraft/world/level/block/piston/PistonStructureResolver.java
|
|
@@ -86,7 +86,7 @@ public class PistonStructureResolver {
|
|
return true;
|
|
} else {
|
|
int i = 1;
|
|
- if (i + this.toPush.size() > 12) {
|
|
+ if (i + this.toPush.size() > org.dreeam.leaf.LeafConfig.pistonBlockPushLimit) { // Purpur
|
|
return false;
|
|
} else {
|
|
while(isSticky(blockState)) {
|
|
@@ -98,7 +98,7 @@ public class PistonStructureResolver {
|
|
}
|
|
|
|
++i;
|
|
- if (i + this.toPush.size() > 12) {
|
|
+ if (i + this.toPush.size() > org.dreeam.leaf.LeafConfig.pistonBlockPushLimit) { // Purpur
|
|
return false;
|
|
}
|
|
}
|
|
@@ -142,7 +142,7 @@ public class PistonStructureResolver {
|
|
return true;
|
|
}
|
|
|
|
- if (this.toPush.size() >= 12) {
|
|
+ if (this.toPush.size() >= org.dreeam.leaf.LeafConfig.pistonBlockPushLimit) { // Purpur
|
|
return false;
|
|
}
|
|
|
|
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
|
index 8b17256c03682f54f1c22c59e16ea7d282574626..cf40152856e51a3c90d6740f45f0e63d582763ed 100644
|
|
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
|
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
|
@@ -259,8 +259,10 @@ public class LeafConfig {
|
|
|
|
public static int spongeAbsorptionArea = 64;
|
|
public static int spongeAbsorptionRadius = 6;
|
|
+ public static int pistonBlockPushLimit = 12;
|
|
private static void blockSettings() {
|
|
spongeAbsorptionArea = getInt("blocks.sponge.absorption.area", spongeAbsorptionArea);
|
|
spongeAbsorptionRadius = getInt("blocks.sponge.absorption.radius", spongeAbsorptionRadius);
|
|
+ pistonBlockPushLimit = getInt("blocks.piston.block-push-limit", pistonBlockPushLimit);
|
|
}
|
|
}
|