1
0
Fork 0

remove more skylight

This commit is contained in:
Sen 2025-08-27 23:53:27 +02:00
parent 0873e0aab0
commit ae0dc2e7cf
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
15 changed files with 128 additions and 300 deletions

View file

@ -20,7 +20,6 @@ public class ChunkServer extends Chunk {
public ChunkServer(WorldServer world, int x, int z) {
super(world, x, z);
this.lightInit = true;
this.updated = true;
}
@ -84,7 +83,6 @@ public class ChunkServer extends Chunk {
}
if(!ceil)
this.genSky();
this.lightInit = true;
this.updated = true;
}
@ -161,14 +159,6 @@ public class ChunkServer extends Chunk {
this.populated = populated;
}
public boolean isLightPopulated() {
return this.lightInit;
}
public void setLightPopulated(boolean populated) {
this.lightInit = populated;
}
public void setModified(boolean modified) {
this.modified = modified;
}

View file

@ -486,7 +486,6 @@ public class Region {
ChunkServer chunk = new ChunkServer(world, x, z);
chunk.setHeights(tag.getIntArray("H"));
chunk.setTerrainPopulated(tag.getBool("P"));
chunk.setLightPopulated(tag.getBool("L"));
chunk.setInhabited(tag.getLong("I"));
List<TagObject> sects = tag.getList("S");
BlockArray[] sections = new BlockArray[sects.size()];
@ -587,7 +586,6 @@ public class Region {
tag.setLong("U", world.getTime());
tag.setIntArray("H", chunk.getHeights());
tag.setBool("P", chunk.isTerrainPopulated());
tag.setBool("L", chunk.isLightPopulated());
tag.setLong("I", chunk.getInhabited());
Set<BlockArray> sections = chunk.getStorage();
List<TagObject> sects = Lists.newArrayList();

View file

@ -1402,7 +1402,7 @@ public final class WorldServer extends AWorldServer {
private void populate(int x, int z) {
ChunkServer chunk = this.getChunk(x, z);
if(!chunk.isTerrainPopulated()) {
chunk.checkLight();
chunk.setTerrainPopulated(true);
if(x < -this.size || z < -this.size || x >= this.size || z >= this.size) {
chunk.setModified(true);
return;
@ -2027,7 +2027,7 @@ public final class WorldServer extends AWorldServer {
return false;
Block block1 = iblockstate.getBlock();
if((flags & 8) == 0 && (block.getLightOpacity() != block1.getLightOpacity() || block.getLight() != block1.getLight()))
this.checkLight(pos);
this.checkBlockLight(pos);
if((flags & 2) != 0 && chunk.isPopulated())
this.markBlockForUpdate(pos);
if((flags & 1) != 0)
@ -2064,7 +2064,7 @@ public final class WorldServer extends AWorldServer {
// if(update) {
// if(!successful)
// newState = old;
this.checkLight(pos);
this.checkBlockLight(pos);
if(chunk.isPopulated())
this.markBlockForUpdate(pos);
// this.notifyNeighborsRespectDebug(pos, old.getBlock());
@ -2186,7 +2186,7 @@ public final class WorldServer extends AWorldServer {
return false;
}
else {
if(pos.getY() >= -World.MAX_SIZE_Y && pos.getY() < World.MAX_SIZE_Y && this.getLightFor(LightType.BLOCK, pos) < 10) {
if(pos.getY() >= -World.MAX_SIZE_Y && pos.getY() < World.MAX_SIZE_Y && this.getLightFor(pos) < 10) {
State iblockstate = this.getState(pos);
Block block = iblockstate.getBlock();

View file

@ -5,7 +5,6 @@ import common.block.Material;
import common.init.Blocks;
import common.rng.Random;
import common.util.BlockPos;
import common.world.LightType;
import common.world.State;
import server.world.WorldServer;
@ -167,7 +166,7 @@ public class FeatureLakes
{
BlockPos blockpos = position.add(i2, j4 - 1, j3);
if (worldIn.getState(blockpos).getBlock() == replace && worldIn.getLightFor(LightType.SKY, position.add(i2, j4, j3)) > 0)
if (worldIn.getState(blockpos).getBlock() == replace && worldIn.getState(blockpos.up()).getBlock() == Blocks.air)
{
worldIn.setState(blockpos, this.top, 2);
}