1
0
Fork 0

remove skylight

This commit is contained in:
Sen 2025-08-27 21:11:45 +02:00
parent 375a67d10f
commit 259bcab1fd
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
12 changed files with 38 additions and 325 deletions

View file

@ -3616,7 +3616,6 @@ public class Client implements IThreadListener {
int j = chunkcoordintpair.x * 16;
int k = chunkcoordintpair.z * 16;
ChunkClient chunk = this.getChunk(chunkcoordintpair.x, chunkcoordintpair.z);
chunk.enqueueRelight();
this.previousActive.add(chunkcoordintpair);
++i;

View file

@ -743,11 +743,6 @@ public class ClientPlayer implements IClientPlayer
ChunkClient chunk = this.gm.getChunk(packetIn.getChunkX(), packetIn.getChunkZ());
chunk.setData(packetIn.getExtractedDataBytes(), packetIn.getExtractedExtend(), packetIn.hasBiomes());
this.gm.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.world.dimension.hasSkyLight()) // TODO: check
{
chunk.resetRelight();
}
}
/**
@ -1342,11 +1337,6 @@ public class ClientPlayer implements IClientPlayer
ChunkClient chunk = this.gm.getChunk(j, k);
chunk.setData(packetIn.getChunkBytes(i), packetIn.getChunkExtend(i), true);
this.gm.markBlockRangeForRenderUpdate(j << 4, -World.MAX_SIZE_Y, k << 4, (j << 4) + 15, World.MAX_SIZE_Y, (k << 4) + 15);
if (!this.world.dimension.hasSkyLight()) // TODO: check
{
chunk.resetRelight();
}
}
}

View file

@ -66,7 +66,6 @@ public class ChunkClient extends Chunk {
public void setData(byte[] data, int[] extend, boolean biomes) {
int pos = 0;
boolean sky = this.world.dimension.hasSkyLight();
if(biomes) {
this.clearArrays();
@ -74,7 +73,7 @@ public class ChunkClient extends Chunk {
for(int cy : extend) {
BlockArray arr = this.getArray(cy);
if(arr == null) {
arr = new BlockArray(cy << 4, sky, null);
arr = new BlockArray(cy << 4, null);
this.setArray(arr);
}
@ -95,17 +94,6 @@ public class ChunkClient extends Chunk {
}
}
if(sky) {
for(int cy : extend) {
BlockArray arr = this.getArray(cy);
if(arr != null) {
NibbleArray slight = arr.getSkylight();
System.arraycopy(data, pos, slight.getData(), 0, slight.getData().length);
pos += slight.getData().length;
}
}
}
if(biomes) {
for(int k = 0; k < this.temperatures.length; ++k) {
this.temperatures[k] = Float.intBitsToFloat((int)((data[pos + 3] & 255) << 24 | (data[pos + 2] & 255) << 16 | (data[pos + 1] & 255) << 8 | data[pos] & 255));