Skip to content

Commit

Permalink
chore: Remove legacy force modification override
Browse files Browse the repository at this point in the history
In the past, it was considered an exception to suggest that blocks
that had the same classes would be considered "modifications"
rather than "placements". Now we can remove the behavior and
exceptionalism.
  • Loading branch information
gabizou committed May 18, 2024
1 parent 91da7e6 commit 10c8296
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ default BlockChange associateBlockChangeWithSnapshot(
final Block currentBlock = currentState.getBlock();
if ((currentState.getOptionalValue(BlockStateProperties.WATERLOGGED).orElse(false) && newBlock == Blocks.WATER) || newBlock == Blocks.AIR) {
return BlockChange.BREAK;
} else if (newBlock != currentBlock && !TrackingUtil.forceModify(currentBlock, newBlock)) {
} else if (newBlock != currentBlock) {
return BlockChange.PLACE;
}
return BlockChange.MODIFY;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,15 +373,6 @@ public static boolean fireMinecraftBlockEvent(final ServerLevel worldIn, final B
return result;
}

static boolean forceModify(final Block originalBlock, final Block newBlock) {
if (originalBlock instanceof RepeaterBlock && newBlock instanceof RepeaterBlock) {
return true;
} else if (originalBlock instanceof RedstoneTorchBlock && newBlock instanceof RedstoneTorchBlock) {
return true;
} else
return originalBlock instanceof RedstoneLampBlock && newBlock instanceof RedstoneLampBlock;
}

private TrackingUtil() {
}

Expand Down

0 comments on commit 10c8296

Please sign in to comment.