aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNassim Jahnke <[email protected]>2021-12-19 22:39:15 +0100
committerNassim Jahnke <[email protected]>2021-12-20 12:10:26 +0100
commit6178609e1d7e9fda3d59786b69425a3b00d73298 (patch)
tree1d7f18b349c07e429a972c2f24f822da2fdc6f6a
parent8c5be166861b662d0b4aa775f0e38c8acb9a30f1 (diff)
downloadPaper-6178609e1d7e9fda3d59786b69425a3b00d73298.tar.gz
Paper-6178609e1d7e9fda3d59786b69425a3b00d73298.zip
Fix tripwire state inconsistency
-rw-r--r--patches/server/0833-Fix-tripwire-state-inconsistency.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/patches/server/0833-Fix-tripwire-state-inconsistency.patch b/patches/server/0833-Fix-tripwire-state-inconsistency.patch
new file mode 100644
index 0000000000..d3a454f329
--- /dev/null
+++ b/patches/server/0833-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;