From 8a5d6d18f8e4c0ca31e4f28e8644e1fdad34ad72 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Sun, 19 Dec 2021 22:39:15 +0100 Subject: [PATCH] Fix tripwire state inconsistency --- .../Fix-tripwire-state-inconsistency.patch | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 patches/server/Fix-tripwire-state-inconsistency.patch diff --git a/patches/server/Fix-tripwire-state-inconsistency.patch b/patches/server/Fix-tripwire-state-inconsistency.patch new file mode 100644 index 0000000000..bc5a74f562 --- /dev/null +++ b/patches/server/Fix-tripwire-state-inconsistency.patch @@ -0,0 +1,45 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Nassim Jahnke +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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/level/block/TripWireBlock.java ++++ b/src/main/java/net/minecraft/world/level/block/TripWireBlock.java +@@ -0,0 +0,0 @@ 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 + } + } + +@@ -0,0 +0,0 @@ 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; +@@ -0,0 +0,0 @@ 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;