mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Configurable piston push limit
This commit is contained in:
@@ -1,53 +0,0 @@
|
|||||||
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] Configurable piston push limit
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/level/block/piston/PistonStructureResolver.java b/net/minecraft/world/level/block/piston/PistonStructureResolver.java
|
|
||||||
index 205e223c356634bd6bc6bd58c6f0b7fda61a6f5f..bea05cb928d540a2f19b51bb7352d032b2dd69cd 100644
|
|
||||||
--- a/net/minecraft/world/level/block/piston/PistonStructureResolver.java
|
|
||||||
+++ b/net/minecraft/world/level/block/piston/PistonStructureResolver.java
|
|
||||||
@@ -81,7 +81,7 @@ public class PistonStructureResolver {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
int i = 1;
|
|
||||||
- if (i + this.toPush.size() > 12) {
|
|
||||||
+ if (i + this.toPush.size() > this.level.purpurConfig.pistonBlockPushLimit) { // Purpur
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
while (isSticky(blockState)) {
|
|
||||||
@@ -95,7 +95,7 @@ public class PistonStructureResolver {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (++i + this.toPush.size() > 12) {
|
|
||||||
+ if (++i + this.toPush.size() > this.level.purpurConfig.pistonBlockPushLimit) { // Purpur
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -140,7 +140,7 @@ public class PistonStructureResolver {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (this.toPush.size() >= 12) {
|
|
||||||
+ if (this.toPush.size() >= this.level.purpurConfig.pistonBlockPushLimit) { // Purpur
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
||||||
index 176dc97524c6383a4c10ebd0918fd2ca209af3b0..19e77eadb5ece2da43eb82f7b7d196e1616348af 100644
|
|
||||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
||||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
||||||
@@ -572,6 +572,11 @@ public class PurpurWorldConfig {
|
|
||||||
lavaSpeedNotNether = getInt("blocks.lava.speed.not-nether", lavaSpeedNotNether);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ public int pistonBlockPushLimit = 12;
|
|
||||||
+ private void pistonSettings() {
|
|
||||||
+ pistonBlockPushLimit = getInt("blocks.piston.block-push-limit", pistonBlockPushLimit);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
public boolean powderSnowBypassMobGriefing = false;
|
|
||||||
private void powderSnowSettings() {
|
|
||||||
powderSnowBypassMobGriefing = getBoolean("blocks.powder_snow.bypass-mob-griefing", powderSnowBypassMobGriefing);
|
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
--- a/net/minecraft/world/level/block/piston/PistonStructureResolver.java
|
||||||
|
+++ b/net/minecraft/world/level/block/piston/PistonStructureResolver.java
|
||||||
|
@@ -81,7 +_,7 @@
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
int i = 1;
|
||||||
|
- if (i + this.toPush.size() > 12) {
|
||||||
|
+ if (i + this.toPush.size() > this.level.purpurConfig.pistonBlockPushLimit) { // Purpur - Configurable piston push limit
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
while (isSticky(blockState)) {
|
||||||
|
@@ -95,7 +_,7 @@
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (++i + this.toPush.size() > 12) {
|
||||||
|
+ if (++i + this.toPush.size() > this.level.purpurConfig.pistonBlockPushLimit) { // Purpur - Configurable piston push limit
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -140,7 +_,7 @@
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (this.toPush.size() >= 12) {
|
||||||
|
+ if (this.toPush.size() >= this.level.purpurConfig.pistonBlockPushLimit) { // Purpur - Configurable piston push limit
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -564,6 +564,11 @@ public class PurpurWorldConfig {
|
|||||||
lavaSpeedNotNether = getInt("blocks.lava.speed.not-nether", lavaSpeedNotNether);
|
lavaSpeedNotNether = getInt("blocks.lava.speed.not-nether", lavaSpeedNotNether);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int pistonBlockPushLimit = 12;
|
||||||
|
private void pistonSettings() {
|
||||||
|
pistonBlockPushLimit = getInt("blocks.piston.block-push-limit", pistonBlockPushLimit);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean powderSnowBypassMobGriefing = false;
|
public boolean powderSnowBypassMobGriefing = false;
|
||||||
private void powderSnowSettings() {
|
private void powderSnowSettings() {
|
||||||
powderSnowBypassMobGriefing = getBoolean("blocks.powder_snow.bypass-mob-griefing", powderSnowBypassMobGriefing);
|
powderSnowBypassMobGriefing = getBoolean("blocks.powder_snow.bypass-mob-griefing", powderSnowBypassMobGriefing);
|
||||||
|
|||||||
Reference in New Issue
Block a user