1
0
Fork 0

fix broken height map updates

This commit is contained in:
Sen 2025-09-01 16:28:19 +02:00
parent 1ce918c0af
commit 364ada6346
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
3 changed files with 18 additions and 20 deletions

View file

@ -155,7 +155,7 @@ public abstract class Chunk {
return this.getBlock0(pos.getX() & 15, pos.getY(), pos.getZ() & 15);
}
public State setState(LocalPos pos, State state, boolean updateHeight) {
public State setState(LocalPos pos, State state) {
int x = pos.getX() & 15;
int y = pos.getY();
int z = pos.getZ() & 15;
@ -202,22 +202,20 @@ public abstract class Chunk {
return null;
}
else {
if(updateHeight) {
if(up) {
this.genHeightMap();
if(up) {
this.genHeightMap();
}
else {
int b = block.getLightOpacity();
int ob = oldb.getLightOpacity();
if(b > 0) {
if(y >= h) {
this.updateHeight(x, y + 1, z);
}
}
else {
int b = block.getLightOpacity();
int ob = oldb.getLightOpacity();
if(b > 0) {
if(y >= h) {
this.updateHeight(x, y + 1, z);
}
}
else if(y == h - 1) {
this.updateHeight(x, y, z);
}
else if(y == h - 1) {
this.updateHeight(x, y, z);
}
}

View file

@ -174,7 +174,7 @@ public abstract class World implements IWorldAccess {
return false;
Chunk chunk = this.getChunk(pos);
Block block = newState.getBlock();
State iblockstate = chunk.setState(pos, newState, true);
State iblockstate = chunk.setState(pos, newState);
if(iblockstate == null)
return false;
Block block1 = iblockstate.getBlock();