mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-02 16:49:56 +01:00
Make sure boundary condition is respected - getHighestBlockY must return 1 or higher
This commit is contained in:
parent
2ccf70d3fe
commit
920dea04ee
@ -94,14 +94,12 @@ public class CraftChunkSnapshot {
|
||||
}
|
||||
|
||||
public int getHighestBlockYAt(int x, int z) {
|
||||
int off = x << 11 | z << 7 | 127;
|
||||
int off = x << 11 | z << 7 | 126;
|
||||
int i;
|
||||
for(i = 127; (i >= 0); i--, off--) {
|
||||
for(i = 127; (i >= 2); i--, off--) {
|
||||
if(buf[off] != 0) {
|
||||
if(i < 127) i++;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user