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

@ -1969,8 +1969,8 @@ public class Client implements IThreadListener {
String.format("Biom: %.2f K, N: %.2f K, D: %s (%s)", chunk.getTemperature(pos), chunk.getOffset(pos),
Color.stripCodes(this.world.dimension.getDisplay()),
this.dimensionName) + "\n" +
"Licht: " + chunk.getLightSub(pos, 0) + " (" + chunk.getLight(LightType.SKY, pos) + " Himmel, "
+ chunk.getLight(LightType.BLOCK, pos) + " Blöcke, " + String.format(
"Licht: " + chunk.getLightSub(pos, 0) + (this.world.dimension.hasSkyLight() ? " (" + World.getSkyLightFor(pos.getY()) + " Himmel, " : "")
+ chunk.getLight(pos) + " Blöcke, " + String.format(
"%.1f", this.renderer.getSunBrightness(1.0f) * 15.0f) + " Welt), A: "
+ String.format("%.1f °", this.world.getCelestialAngle(1.0f)) + "\n" +
String.format("Zeit: %s" + (this.world.dimension.hasRotation() ? ", R %d / %d T" : "") + (this.world.dimension.hasOrbit() ? ", U %d / %d T" : ""),

View file

@ -10,7 +10,6 @@ import common.util.BlockPos;
import common.util.Facing;
import common.util.Vec3i;
import common.world.IWorldAccess;
import common.world.LightType;
import common.world.State;
import common.world.World;
@ -127,8 +126,8 @@ public class RegionRenderCache implements IWorldAccess
public int getLight(BlockPos pos, int lightValue)
{
int i = this.getLightForExt(LightType.SKY, pos);
int j = this.getLightForExt(LightType.BLOCK, pos);
int i = this.sky ? World.getSkyLightFor(pos.getY()) : 0;
int j = this.getBlockLightExt(pos);
if (j < lightValue)
{
@ -138,13 +137,9 @@ public class RegionRenderCache implements IWorldAccess
return i << 20 | j << 4;
}
private int getLightForExt(LightType p_175629_1_, BlockPos pos)
private int getBlockLightExt(BlockPos pos)
{
if (p_175629_1_ == LightType.SKY && !this.sky)
{
return 0;
}
else if (pos.getY() >= -World.MAX_SIZE_Y && pos.getY() < World.MAX_SIZE_Y)
if (pos.getY() >= -World.MAX_SIZE_Y && pos.getY() < World.MAX_SIZE_Y)
{
if (this.getState(pos).getBlock().getSumBrightness())
{
@ -152,7 +147,7 @@ public class RegionRenderCache implements IWorldAccess
for (Facing enumfacing : Facing.values())
{
int k = this.getLightFor(p_175629_1_, pos.offset(enumfacing));
int k = this.getBlockLight(pos.offset(enumfacing));
if (k > l)
{
@ -171,26 +166,26 @@ public class RegionRenderCache implements IWorldAccess
{
int i = (pos.getX() >> 4) - this.xPos;
int j = (pos.getZ() >> 4) - this.zPos;
return this.chunks[i][j].getLight(p_175629_1_, pos);
return this.chunks[i][j].getLight(pos);
}
}
else
{
return p_175629_1_.defValue;
return 0;
}
}
public int getLightFor(LightType type, BlockPos pos)
private int getBlockLight(BlockPos pos)
{
if (pos.getY() >= -World.MAX_SIZE_Y && pos.getY() < World.MAX_SIZE_Y)
{
int i = (pos.getX() >> 4) - this.xPos;
int j = (pos.getZ() >> 4) - this.zPos;
return this.chunks[i][j].getLight(type, pos);
return this.chunks[i][j].getLight(pos);
}
else
{
return type.defValue;
return 0;
}
}
}

View file

@ -5,10 +5,6 @@ import java.nio.ByteOrder;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import java.nio.ShortBuffer;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Comparator;
import common.log.Log;
import common.util.ExtMath;

View file

@ -110,7 +110,6 @@ public class ChunkClient extends Chunk {
}
}
this.lightInit = true;
this.populated = true;
this.genHeights();

View file

@ -73,11 +73,11 @@ public class ChunkEmpty extends ChunkClient {
return pos.getY() < this.liquidY ? this.dummyBlock : (pos.getY() == this.liquidY ? this.liquidBlock : Blocks.air);
}
public int getLight(LightType type, BlockPos pos) {
return type.defValue;
public int getLight(BlockPos pos) {
return 0;
}
public void setLight(LightType type, BlockPos pos, int value) {
public void setLight(BlockPos pos, int value) {
}
public int getLightSub(BlockPos pos, int amount) {
@ -161,7 +161,7 @@ public class ChunkEmpty extends ChunkClient {
public void enqueueRelight() {
}
public void checkLight() {
public void setPopulated() {
}
public boolean isLoaded() {