Archived
0

оптимизация передачи данных block light

This commit is contained in:
2018-11-10 17:39:57 +03:00
parent 146609f899
commit be2b2e6ef8
2 changed files with 14 additions and 15 deletions

View File

@@ -23,9 +23,17 @@ public class BlockLocation implements Cloneable {
public BlockLocation toGlobal(ChunkSection chunkSection) {
return new BlockLocation(
(chunkSection.getX() << 8) + x,
(chunkSection.getY() << 8) + y,
(chunkSection.getZ() << 8) + z
(chunkSection.getX() << 4) + x,
(chunkSection.getY() << 4) + y,
(chunkSection.getZ() << 4) + z
);
}
public BlockLocation toLocal() {
return new BlockLocation(
x - (x >> 4 << 4),
y - (y >> 4 << 4),
z - (z >> 4 << 4)
);
}