Skip to content

Commit

Permalink
Fix oddities in chunk sections with older Spigot versions (GeyserMC#1758
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Camotoy authored Dec 30, 2020
1 parent e3b94bc commit a17f220
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public void getBlocksInSection(GeyserSession session, int x, int y, int z, Chunk
for (int blockY = 0; blockY < 16; blockY++) { // Cache-friendly iteration order
for (int blockZ = 0; blockZ < 16; blockZ++) {
for (int blockX = 0; blockX < 16; blockX++) {
Block block = world.getBlockAt(x, y, z);
Block block = world.getBlockAt((x << 4) + blockX, (y << 4) + blockY, (z << 4) + blockZ);
// Black magic that gets the old block state ID
int blockId = (block.getType().getId() << 4) | (block.getData() & 0xF);
chunk.set(blockX, blockY, blockZ, getLegacyBlock(storage, blockId, (x << 4) + blockX, (y << 4) + blockY, (z << 4) + blockZ));
Expand Down

0 comments on commit a17f220

Please sign in to comment.