fix broken height map updates
This commit is contained in:
parent
1ce918c0af
commit
364ada6346
3 changed files with 18 additions and 20 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue