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); 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 x = pos.getX() & 15;
int y = pos.getY(); int y = pos.getY();
int z = pos.getZ() & 15; int z = pos.getZ() & 15;
@ -202,7 +202,6 @@ public abstract class Chunk {
return null; return null;
} }
else { else {
if(updateHeight) {
if(up) { if(up) {
this.genHeightMap(); this.genHeightMap();
} }
@ -219,7 +218,6 @@ public abstract class Chunk {
this.updateHeight(x, y, z); this.updateHeight(x, y, z);
} }
} }
}
if(oldb instanceof ITileEntityProvider) { if(oldb instanceof ITileEntityProvider) {
TileEntity tile = this.getTileEntity(pos, TileEntity.CreateMode.CHECK); TileEntity tile = this.getTileEntity(pos, TileEntity.CreateMode.CHECK);

View file

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

View file

@ -930,7 +930,7 @@ public final class WorldServer extends AWorldServer {
if(block != Blocks.air && (block.getMaterial().isLiquid() || power - (block.getResistance() / 5.0F + 0.3F) * 0.3F > 0.0F)) { if(block != Blocks.air && (block.getMaterial().isLiquid() || power - (block.getResistance() / 5.0F + 0.3F) * 0.3F > 0.0F)) {
if(block.canExplosionDrop() && this.rand.floatv() <= 1.0F / (power * power)) if(block.canExplosionDrop() && this.rand.floatv() <= 1.0F / (power * power))
block.drop(this, pos, state, 0); block.drop(this, pos, state, 0);
this.setState(pos, Blocks.air.getState(), power < 40.0F ? 2 : 10); this.setState(pos, Blocks.air.getState(), 2);
block.onDestroyedExplosion(this, pos, source, state); block.onDestroyedExplosion(this, pos, source, state);
return true; return true;
} }
@ -2012,7 +2012,7 @@ public final class WorldServer extends AWorldServer {
return false; return false;
ChunkServer chunk = this.getChunk(pos); ChunkServer chunk = this.getChunk(pos);
Block block = newState.getBlock(); Block block = newState.getBlock();
State iblockstate = chunk.setState(pos, newState, (flags & 8) == 0); State iblockstate = chunk.setState(pos, newState);
if(iblockstate == null) if(iblockstate == null)
return false; return false;
Block block1 = iblockstate.getBlock(); Block block1 = iblockstate.getBlock();
@ -2037,7 +2037,7 @@ public final class WorldServer extends AWorldServer {
} }
return true; return true;
} }
State successState = chunk.setState(pos, newState, true); State successState = chunk.setState(pos, newState);
boolean successful = successState != null; boolean successful = successState != null;
if(successful) { if(successful) {
if(block.getData() != null) { if(block.getData() != null) {