mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-12-26 10:37:44 +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) {
|
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…
Reference in New Issue
Block a user