Add config option for tripwire disarming fix

Fixes #10382

Co-authored-by: Tamion <70228790+notTamion@users.noreply.github.com>
This commit is contained in:
DungeonDev 2024-04-02 12:15:49 +02:00 committed by Nassim Jahnke
parent 45d1486fec
commit e709245b55
No known key found for this signature in database
GPG Key ID: EF6771C01F6EF02F
4 changed files with 11 additions and 9 deletions

View File

@ -482,10 +482,10 @@ index 0000000000000000000000000000000000000000..c01b4393439838976965823298f12e47
+}
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
new file mode 100644
index 0000000000000000000000000000000000000000..7a53374319d5495253f277199114eaf43097456d
index 0000000000000000000000000000000000000000..0aab42ac5d5b0fb8b59eb71d8d3b1ebbc7c76da7
--- /dev/null
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
@@ -0,0 +1,311 @@
@@ -0,0 +1,313 @@
+package io.papermc.paper.configuration;
+
+import co.aikar.timings.MinecraftTimings;
@ -635,6 +635,8 @@ index 0000000000000000000000000000000000000000..7a53374319d5495253f277199114eaf4
+ public UnsupportedSettings unsupportedSettings;
+
+ public class UnsupportedSettings extends ConfigurationPart {
+ @Comment("This setting controls if the broken behavior of disarmed tripwires not breaking should be allowed. This also allows for dupes")
+ public boolean allowTripwireDisarmingExploits = false;
+ @Comment("This setting allows for exploits related to end portals, for example sand duping")
+ public boolean allowUnsafeEndPortalTeleportation = false;
+ @Comment("This setting controls if players should be able to break bedrock, end portals and other intended to be permanent blocks.")
@ -4983,7 +4985,7 @@ index 680a308c466c0056d4213e61f69cf13ee3ff5c61..cd39509d383c47319b71797e5d1df41c
world.serverLevelData.setDifficulty(config.difficulty);
world.setSpawnSettings(config.spawnMonsters, config.spawnAnimals);
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index a7921cde2b6275d730879b2814cc5f430520b051..c8f0570b7d37a0c0bddb0a65c36fb32de584df8f 100644
index 96210dd54e8ff6dc0375a8d03bf14fec1b26aaeb..19725db76dc3a12356993aed7edba507b52fe4d7 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -141,6 +141,19 @@ public class Main {

View File

@ -22,10 +22,10 @@ is actually processed, this is honestly really just exposed for the misnomers or
who just wanna ensure that this won't grow over a specific size if chat gets stupidly active
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
index 7a53374319d5495253f277199114eaf43097456d..7145c3776c85416240408b8e23a1d949da39bad9 100644
index 0aab42ac5d5b0fb8b59eb71d8d3b1ebbc7c76da7..2540b7748e27839552ae88412ecac0aa69485b32 100644
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
@@ -285,7 +285,18 @@ public class GlobalConfiguration extends ConfigurationPart {
@@ -287,7 +287,18 @@ public class GlobalConfiguration extends ConfigurationPart {
@PostProcess
private void postProcess() {

View File

@ -14439,7 +14439,7 @@ index 0000000000000000000000000000000000000000..962d3cae6340fc11607b59355e291629
+
+}
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
index 7145c3776c85416240408b8e23a1d949da39bad9..b53b6cc4463675096b061b3b65f14a4695c742e2 100644
index 2540b7748e27839552ae88412ecac0aa69485b32..d00fc39b19c02895553f40bf5f62daa1dd50d59c 100644
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
@@ -28,6 +28,45 @@ public class GlobalConfiguration extends ConfigurationPart {
@ -14510,7 +14510,7 @@ index 7145c3776c85416240408b8e23a1d949da39bad9..b53b6cc4463675096b061b3b65f14a46
public UnsupportedSettings unsupportedSettings;
public class UnsupportedSettings extends ConfigurationPart {
@@ -200,7 +224,7 @@ public class GlobalConfiguration extends ConfigurationPart {
@@ -202,7 +226,7 @@ public class GlobalConfiguration extends ConfigurationPart {
@PostProcess
private void postProcess() {

View File

@ -6,14 +6,14 @@ Subject: [PATCH] Fix tripwire disarming not working as intended
Fixes MC-129055
diff --git a/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java b/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java
index d9b3877257b31ca1b5acc4a47fbf5b993de69ae0..8bf94fcf5c46ffe6d90f8431338b768ef1a2dd61 100644
index d9b3877257b31ca1b5acc4a47fbf5b993de69ae0..efd8d77a441fd334ea4c09c5e31c6d946c1ae0b7 100644
--- a/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java
@@ -201,9 +201,8 @@ public class TripWireHookBlock extends Block {
BlockState iblockdata4 = aiblockdata[l];
if (iblockdata4 != null) {
+ if (world.getBlockState(blockposition2).is(Blocks.TRIPWIRE)) { // Paper - Fix tripwire disarming not working as intended
+ if (world.getBlockState(blockposition2).is(Blocks.TRIPWIRE) || io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.allowTripwireDisarmingExploits) { // Paper - Fix tripwire disarming not working as intended
world.setBlock(blockposition2, (BlockState) iblockdata4.trySetValue(TripWireHookBlock.ATTACHED, flag4), 3);
- if (!world.getBlockState(blockposition2).isAir()) {
- ;