Skip to content

Commit

Permalink
Remap invalid directional blocks in 1.8 -> 1.7.10
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphiMC committed Apr 1, 2024
1 parent c00850b commit 4998dbe
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public ChunkTracker(final UserConnection user) {
for (int i = 1; i < 7; i++) { // stone variants
this.registerReplacement(new IdAndData(BlockList1_6.stone.blockID, i), new IdAndData(BlockList1_6.stone.blockID, 0));
}
this.registerInvalidDirectionReplacements(BlockList1_6.ladder.blockID, new IdAndData(BlockList1_6.planks.blockID, 0)); // Ladders with broken data values use the last ladder collision box the player has looked at. We just set them to a full block to avoid glitches.
this.registerInvalidDirectionReplacements(BlockList1_6.furnaceBurning.blockID, new IdAndData(BlockList1_6.furnaceBurning.blockID, 2));
this.registerReplacement(new IdAndData(BlockList1_6.chest.blockID, 0), new IdAndData(BlockList1_6.chest.blockID, 3));
}

Expand All @@ -55,5 +57,14 @@ protected void remapBlock(IdAndData block, int x, int y, int z) {
protected void postRemap(DataPalette palette) {
palette.replaceId(BlockList1_6.portal.blockID << 4, 0);
}

private void registerInvalidDirectionReplacements(final int blockId, final IdAndData replacement) {
for (int i = 0; i < 2; i++) {
this.registerReplacement(new IdAndData(blockId, i), replacement);
}
for (int i = 6; i < 16; i++) {
this.registerReplacement(new IdAndData(blockId, i), replacement);
}
}

}

0 comments on commit 4998dbe

Please sign in to comment.