[ci skip] Add more identifying patch comments

This commit is contained in:
Nassim Jahnke
2024-01-18 22:00:40 +01:00
parent 0f611e7b4f
commit 864f4072c1
37 changed files with 220 additions and 225 deletions

View File

@@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
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
+ this.updateSource(world, pos, (BlockState) state.setValue(TripWireBlock.POWERED, true), true); // Paper - fix tripwire state inconsistency
}
}
@@ -22,12 +22,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
private void updateSource(Level world, BlockPos pos, BlockState state) {
+ // Paper start - fix state inconsistency
+ // Paper start - fix tripwire state inconsistency
+ this.updateSource(world, pos, state, false);
+ }
+
+ private void updateSource(Level world, BlockPos pos, BlockState state, boolean beingRemoved) {
+ // Paper end
+ // Paper end - fix tripwire state inconsistency
Direction[] aenumdirection = new Direction[]{Direction.SOUTH, Direction.WEST};
int i = aenumdirection.length;
int j = 0;
@@ -36,7 +36,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (iblockdata1.is(this.hook)) {
if (iblockdata1.getValue(TripWireHookBlock.FACING) == enumdirection.getOpposite()) {
- TripWireHookBlock.calculateState(world, blockposition1, iblockdata1, false, true, k, state);
+ TripWireHookBlock.calculateState(world, blockposition1, iblockdata1, false, true, k, state, beingRemoved); // Paper - fix state inconsistency
+ TripWireHookBlock.calculateState(world, blockposition1, iblockdata1, false, true, k, state, beingRemoved); // Paper - fix tripwire state inconsistency
}
} else if (iblockdata1.is((Block) this)) {
++k;
@@ -50,12 +50,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- public static void calculateState(Level world, BlockPos pos, BlockState state, boolean flag, boolean flag1, int i, @Nullable BlockState iblockdata1) {
+ public static void calculateState(Level world, BlockPos pos, BlockState state, boolean beingRemoved, boolean flag1, int i, @Nullable BlockState iblockdata1) {
+ // Paper start - fix tripwire inconsistency
+ // Paper start - fix tripwire state inconsistency
+ calculateState(world, pos, state, beingRemoved, flag1, i, iblockdata1, false);
+ }
+
+ public static void calculateState(Level world, BlockPos pos, BlockState state, boolean beingRemoved, boolean flag1, int i, @Nullable BlockState iblockdata1, boolean tripWireBeingRemoved) {
+ // Paper end
+ // Paper end - fix tripwire state inconsistency
Optional<Direction> optional = state.getOptionalValue(TripWireHookBlock.FACING);
if (optional.isPresent()) {
@@ -64,7 +64,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
boolean flag3 = (Boolean) state.getOptionalValue(TripWireHookBlock.POWERED).orElse(false);
Block block = state.getBlock();
- boolean flag4 = !flag;
+ boolean flag4 = !beingRemoved; // Paper
+ boolean flag4 = !beingRemoved; // Paper - fix tripwire state inconsistency
boolean flag5 = false;
int j = 0;
BlockState[] aiblockdata = new BlockState[42];
@@ -72,7 +72,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
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
+ if (k != i || !tripWireBeingRemoved || !flag6) // Paper - fix tripwire state inconsistency; don't update the tripwire again if being removed and not disarmed
aiblockdata[k] = iblockdata2;
if (k == i) {
world.scheduleTick(pos, block, 10);
@@ -81,7 +81,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
TripWireHookBlock.emitState(world, pos, flag4, flag5, flag2, flag3);
- if (!flag) {
+ if (!beingRemoved) { // Paper
+ if (!beingRemoved) { // Paper - fix tripwire state inconsistency
if (world.getBlockState(pos).getBlock() == Blocks.TRIPWIRE_HOOK) // Paper - validate
world.setBlock(pos, (BlockState) iblockdata3.setValue(TripWireHookBlock.FACING, enumdirection), 3);
if (flag1) {