Update "new location" method to accept locations at Y positions higher than the old 128 limit; vertical limit is now based on Bukkit's reported World.getMaxHeight() value

This commit is contained in:
Brettflan 2012-03-03 07:04:02 -06:00
parent 60e74901c6
commit 8bfb1c7894
1 changed files with 2 additions and 1 deletions

View File

@ -206,11 +206,12 @@ public class BorderData
);
}
private static final int limTop = 126, limBot = 1;
private static final int limBot = 1;
// find closest safe Y position from the starting position
private double getSafeY(World world, int X, int Y, int Z)
{
final int limTop = world.getMaxHeight() - 2;
// Expanding Y search method adapted from Acru's code in the Nether plugin
for(int y1 = Y, y2 = Y; (y1 > limBot) || (y2 < limTop); y1--, y2++){