change biome packet

This commit is contained in:
Sen 2025-05-24 18:49:24 +02:00
parent 88c43d0824
commit ffca1f62e5
7 changed files with 50 additions and 80 deletions

View file

@ -780,7 +780,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
{
NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController);
ChunkClient chunk = this.clientWorldController.getChunk(packetIn.getChunkX(), packetIn.getChunkZ());
chunk.setBiomes(packetIn.getBiomes());
chunk.setBiome(packetIn.getPos(), packetIn.getBiome());
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);
}

View file

@ -133,6 +133,10 @@ public class ChunkClient extends Chunk {
int z = pos.getZ() & 15;
return Biome.getBiomeDef(this.biomes[z << 4 | x] & 255);
}
public void setBiome(BlockPos pos, Biome biome) {
this.biomes[((pos.getZ() & 15) << 4 | pos.getX() & 15)] = (byte)biome.id;
}
public boolean isDummy() {
return false;

View file

@ -107,7 +107,7 @@ public class ChunkEmpty extends ChunkClient {
return Biome.DEF_BIOME;
}
public void setBiomes(byte[] biomes) {
public void setBiome(BlockPos pos, Biome biome) {
}
public void resetRelight() {