aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0829-Fix-tripwire-state-inconsistency.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0829-Fix-tripwire-state-inconsistency.patch')
-rw-r--r--patches/server/0829-Fix-tripwire-state-inconsistency.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/patches/server/0829-Fix-tripwire-state-inconsistency.patch b/patches/server/0829-Fix-tripwire-state-inconsistency.patch
new file mode 100644
index 0000000000..d3a454f329
--- /dev/null
+++ b/patches/server/0829-Fix-tripwire-state-inconsistency.patch
@@ -0,0 +1,45 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Nassim Jahnke <[email protected]>
+Date: Sun, 19 Dec 2021 21:11:20 +0100
+Subject: [PATCH] Fix tripwire state inconsistency
+
+
+diff --git a/src/main/java/net/minecraft/world/level/block/TripWireBlock.java b/src/main/java/net/minecraft/world/level/block/TripWireBlock.java
+index 6b40bf94fbaa18605b59b92ad1582e8dc3a6a9cd..335129abd06086d128f803bb488672b35f357389 100644
+--- a/src/main/java/net/minecraft/world/level/block/TripWireBlock.java
++++ b/src/main/java/net/minecraft/world/level/block/TripWireBlock.java
+@@ -74,7 +74,7 @@ public class TripWireBlock extends Block {
+ @Override
+ public void onRemove(BlockState state, Level world, BlockPos pos, BlockState newState, boolean moved) {
+ if (!moved && !state.is(newState.getBlock())) {
+- this.updateSource(world, pos, (BlockState) state.setValue(TripWireBlock.POWERED, true));
++ this.updateSource(world, pos, (BlockState) state.setValue(TripWireBlock.POWERED, true), true); // Paper - fix state inconsistency
+ }
+ }
+
+@@ -89,6 +89,12 @@ public class TripWireBlock extends Block {
+ }
+
+ private void updateSource(Level world, BlockPos pos, BlockState state) {
++ // Paper start - fix state inconsistency
++ this.updateSource(world, pos, state, false);
++ }
++
++ private void updateSource(Level world, BlockPos pos, BlockState state, boolean beingRemoved) {
++ // Paper end
+ Direction[] aenumdirection = new Direction[]{Direction.SOUTH, Direction.WEST};
+ int i = aenumdirection.length;
+ int j = 0;
+@@ -104,7 +110,11 @@ public class TripWireBlock extends Block {
+
+ if (iblockdata1.is((Block) this.hook)) {
+ if (iblockdata1.getValue(TripWireHookBlock.FACING) == enumdirection.getOpposite()) {
+- this.hook.calculateState(world, blockposition1, iblockdata1, false, true, k, state);
++ // Paper - fix state inconsistency
++ final int distance = beingRemoved ? -1 : k;
++ final BlockState self = beingRemoved ? null : state;
++ this.hook.calculateState(world, blockposition1, iblockdata1, false, true, distance, self);
++ // Paper end
+ }
+ } else if (iblockdata1.is((Block) this)) {
+ ++k;