mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Fix tripwire state inconsistency
This commit is contained in:
parent
a08630ed35
commit
8a5d6d18f8
1 changed files with 45 additions and 0 deletions
45
patches/server/Fix-tripwire-state-inconsistency.patch
Normal file
45
patches/server/Fix-tripwire-state-inconsistency.patch
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Nassim Jahnke <nassim@njahnke.dev>
|
||||||
|
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;
|
Loading…
Reference in a new issue