make chunk storage a map

This commit is contained in:
Sen 2025-05-21 15:31:50 +02:00
parent 5e2b36dc82
commit 2dd83c61dc
9 changed files with 144 additions and 328 deletions

View file

@ -756,7 +756,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
if (packetIn.hasBiomes())
{
if (packetIn.getExtractedSize() == 0)
if (packetIn.getExtractedExtend().length == 0)
{
this.clientWorldController.doPreChunk(packetIn.getChunkX(), packetIn.getChunkZ(), false);
return;
@ -767,7 +767,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
// this.clientWorldController.invalidateBlockReceiveRegion(packetIn.getChunkX() << 4, 0, packetIn.getChunkZ() << 4, (packetIn.getChunkX() << 4) + 15, 512, (packetIn.getChunkZ() << 4) + 15);
Chunk chunk = this.clientWorldController.getChunk(packetIn.getChunkX(), packetIn.getChunkZ());
chunk.setData(packetIn.getExtractedDataBytes(), packetIn.getExtractedSize(), packetIn.getExtractedExtend(), packetIn.hasBiomes());
chunk.setData(packetIn.getExtractedDataBytes(), packetIn.getExtractedExtend(), packetIn.hasBiomes());
this.clientWorldController.markBlockRangeForRenderUpdate(packetIn.getChunkX() << 4, -World.MAX_SIZE_Y, packetIn.getChunkZ() << 4, (packetIn.getChunkX() << 4) + 15, World.MAX_SIZE_Y, (packetIn.getChunkZ() << 4) + 15);
if (!packetIn.hasBiomes() || this.clientWorldController.dimension.hasNoLight()) // TODO: check
@ -1413,7 +1413,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
this.clientWorldController.doPreChunk(j, k, true);
// this.clientWorldController.invalidateBlockReceiveRegion(j << 4, 0, k << 4, (j << 4) + 15, 512, (k << 4) + 15);
Chunk chunk = this.clientWorldController.getChunk(j, k);
chunk.setData(packetIn.getChunkBytes(i), packetIn.getChunkSize(i), packetIn.getChunkExtend(i), true);
chunk.setData(packetIn.getChunkBytes(i), packetIn.getChunkExtend(i), true);
this.clientWorldController.markBlockRangeForRenderUpdate(j << 4, -World.MAX_SIZE_Y, k << 4, (j << 4) + 15, World.MAX_SIZE_Y, (k << 4) + 15);
if (this.clientWorldController.dimension.hasNoLight()) // TODO: check

View file

@ -105,7 +105,7 @@ public class EmptyChunk extends Chunk {
return true;
}
public void setData(byte[] data, int update, int[] extend, boolean biomes) {
public void setData(byte[] data, int[] extend, boolean biomes) {
}
public Biome getBiome(BlockPos pos, BiomeGenerator gen) {