Remap invalid directional blocks in 1.8 -> 1.7.10

This commit is contained in:
RaphiMC 2024-04-01 23:23:47 +02:00
parent c00850bb25
commit 4998dbec16
No known key found for this signature in database
GPG Key ID: 0F6BB0657A03AC94

View File

@ -37,6 +37,8 @@ public class ChunkTracker extends AbstractChunkTracker {
for (int i = 1; i < 7; i++) { // stone variants 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.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)); this.registerReplacement(new IdAndData(BlockList1_6.chest.blockID, 0), new IdAndData(BlockList1_6.chest.blockID, 3));
} }
@ -55,5 +57,14 @@ public class ChunkTracker extends AbstractChunkTracker {
protected void postRemap(DataPalette palette) { protected void postRemap(DataPalette palette) {
palette.replaceId(BlockList1_6.portal.blockID << 4, 0); 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);
}
}
} }