Make sure boundary condition is respected - getHighestBlockY must return 1 or higher
This commit is contained in:
parent
2299df445a
commit
4662328bb9
1 changed files with 2 additions and 4 deletions
|
|
@ -94,14 +94,12 @@ public class CraftChunkSnapshot {
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getHighestBlockYAt(int x, int z) {
|
public int getHighestBlockYAt(int x, int z) {
|
||||||
int off = x << 11 | z << 7 | 127;
|
int off = x << 11 | z << 7 | 126;
|
||||||
int i;
|
int i;
|
||||||
for(i = 127; (i >= 0); i--, off--) {
|
for(i = 127; (i >= 2); i--, off--) {
|
||||||
if(buf[off] != 0) {
|
if(buf[off] != 0) {
|
||||||
if(i < 127) i++;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue