diff options
author | Jake Potrebic <[email protected]> | 2023-06-08 21:29:58 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2023-06-08 21:29:58 -0700 |
commit | 82c64790f43239051625385e3e72b26fe17626e1 (patch) | |
tree | 69567a33f5307dc8dd09e2d44c1e91b47214667e /patches/server/0751-Fix-tripwire-state-inconsistency.patch | |
parent | e829a9d8f3a52a4803eaaa96a046c4a4876a262a (diff) | |
download | Paper-82c64790f43239051625385e3e72b26fe17626e1.tar.gz Paper-82c64790f43239051625385e3e72b26fe17626e1.zip |
Add back Anti-Xray patch (#9283)
Diffstat (limited to 'patches/server/0751-Fix-tripwire-state-inconsistency.patch')
-rw-r--r-- | patches/server/0751-Fix-tripwire-state-inconsistency.patch | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/patches/server/0751-Fix-tripwire-state-inconsistency.patch b/patches/server/0751-Fix-tripwire-state-inconsistency.patch deleted file mode 100644 index eba71d4136..0000000000 --- a/patches/server/0751-Fix-tripwire-state-inconsistency.patch +++ /dev/null @@ -1,67 +0,0 @@ -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 - -This patch prevents updating and re-setting the tripwire when being removed in certain conditions - -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 4e2fb4ee8e46b3c363992ff23e26f5a648c5f003..7f60175bf671d282c11e9084670d2bb900968255 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,7 @@ 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); -+ this.hook.calculateState(world, blockposition1, iblockdata1, false, true, k, state, beingRemoved); // Paper - fix state inconsistency - } - } else if (iblockdata1.is((Block) this)) { - ++k; -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 4a516828e5c6abd63511ee7c93fcff11203cf8d0..004dce26ff073f1de52a84cd425c4f60fdab5e50 100644 ---- a/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java -+++ b/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java -@@ -108,6 +108,12 @@ public class TripWireHookBlock extends Block { - } - - public void calculateState(Level world, BlockPos pos, BlockState state, boolean beingRemoved, boolean flag1, int i, @Nullable BlockState iblockdata1) { -+ // Paper start - fix tripwire inconsistency -+ this.calculateState(world, pos, state, beingRemoved, flag1, i, iblockdata1, false); -+ } -+ -+ public void calculateState(Level world, BlockPos pos, BlockState state, boolean beingRemoved, boolean flag1, int i, @Nullable BlockState iblockdata1, boolean tripWireBeingRemoved) { -+ // Paper end - Direction enumdirection = (Direction) state.getValue(TripWireHookBlock.FACING); - boolean flag2 = (Boolean) state.getValue(TripWireHookBlock.ATTACHED); - boolean flag3 = (Boolean) state.getValue(TripWireHookBlock.POWERED); -@@ -141,6 +147,7 @@ public class TripWireHookBlock extends Block { - boolean flag7 = (Boolean) iblockdata2.getValue(TripWireBlock.POWERED); - - flag5 |= flag6 && flag7; -+ if (k != i || !tripWireBeingRemoved || !flag6) // Paper - don't update the tripwire again if being removed and not disarmed - aiblockdata[k] = iblockdata2; - if (k == i) { - world.scheduleTick(pos, (Block) this, 10); |