From 8bfb1c789405da669cc24af8ec788c1d0cb0ca7b Mon Sep 17 00:00:00 2001 From: Brettflan Date: Sat, 3 Mar 2012 07:04:02 -0600 Subject: [PATCH] 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 --- src/com/wimbli/WorldBorder/BorderData.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/wimbli/WorldBorder/BorderData.java b/src/com/wimbli/WorldBorder/BorderData.java index 43fae97..f52b610 100644 --- a/src/com/wimbli/WorldBorder/BorderData.java +++ b/src/com/wimbli/WorldBorder/BorderData.java @@ -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++){