diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java index ea34ff723b..d348339145 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -67,7 +67,7 @@ public class GeoEngine } /** - * GeoEngine contructor. Loads all geodata files of chosen geodata format. + * GeoEngine constructor. Loads all geodata files of chosen geodata format. */ public GeoEngine() { @@ -314,7 +314,8 @@ public class GeoEngine */ public final short getHeightNearest(int geoX, int geoY, int worldZ) { - return getBlock(geoX, geoY).getHeightNearest(geoX, geoY, worldZ); + final ABlock block = getBlock(geoX, geoY); + return block != null ? block.getHeightNearest(geoX, geoY, worldZ) : (short) worldZ; } /** @@ -327,7 +328,8 @@ public class GeoEngine */ public final short getHeightNearestOriginal(int geoX, int geoY, int worldZ) { - return getBlock(geoX, geoY).getHeightNearestOriginal(geoX, geoY, worldZ); + final ABlock block = getBlock(geoX, geoY); + return block != null ? block.getHeightNearestOriginal(geoX, geoY, worldZ) : (short) worldZ; } /** @@ -339,7 +341,8 @@ public class GeoEngine */ public final byte getNsweNearest(int geoX, int geoY, int worldZ) { - return getBlock(geoX, geoY).getNsweNearest(geoX, geoY, worldZ); + final ABlock block = getBlock(geoX, geoY); + return block != null ? block.getNsweNearest(geoX, geoY, worldZ) : (byte) 0xFF; } /** @@ -352,7 +355,8 @@ public class GeoEngine */ public final byte getNsweNearestOriginal(int geoX, int geoY, int worldZ) { - return getBlock(geoX, geoY).getNsweNearestOriginal(geoX, geoY, worldZ); + final ABlock block = getBlock(geoX, geoY); + return block != null ? block.getNsweNearestOriginal(geoX, geoY, worldZ) : (byte) 0xFF; } /** diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java index ea34ff723b..d348339145 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -67,7 +67,7 @@ public class GeoEngine } /** - * GeoEngine contructor. Loads all geodata files of chosen geodata format. + * GeoEngine constructor. Loads all geodata files of chosen geodata format. */ public GeoEngine() { @@ -314,7 +314,8 @@ public class GeoEngine */ public final short getHeightNearest(int geoX, int geoY, int worldZ) { - return getBlock(geoX, geoY).getHeightNearest(geoX, geoY, worldZ); + final ABlock block = getBlock(geoX, geoY); + return block != null ? block.getHeightNearest(geoX, geoY, worldZ) : (short) worldZ; } /** @@ -327,7 +328,8 @@ public class GeoEngine */ public final short getHeightNearestOriginal(int geoX, int geoY, int worldZ) { - return getBlock(geoX, geoY).getHeightNearestOriginal(geoX, geoY, worldZ); + final ABlock block = getBlock(geoX, geoY); + return block != null ? block.getHeightNearestOriginal(geoX, geoY, worldZ) : (short) worldZ; } /** @@ -339,7 +341,8 @@ public class GeoEngine */ public final byte getNsweNearest(int geoX, int geoY, int worldZ) { - return getBlock(geoX, geoY).getNsweNearest(geoX, geoY, worldZ); + final ABlock block = getBlock(geoX, geoY); + return block != null ? block.getNsweNearest(geoX, geoY, worldZ) : (byte) 0xFF; } /** @@ -352,7 +355,8 @@ public class GeoEngine */ public final byte getNsweNearestOriginal(int geoX, int geoY, int worldZ) { - return getBlock(geoX, geoY).getNsweNearestOriginal(geoX, geoY, worldZ); + final ABlock block = getBlock(geoX, geoY); + return block != null ? block.getNsweNearestOriginal(geoX, geoY, worldZ) : (byte) 0xFF; } /** diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java index ea34ff723b..d348339145 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -67,7 +67,7 @@ public class GeoEngine } /** - * GeoEngine contructor. Loads all geodata files of chosen geodata format. + * GeoEngine constructor. Loads all geodata files of chosen geodata format. */ public GeoEngine() { @@ -314,7 +314,8 @@ public class GeoEngine */ public final short getHeightNearest(int geoX, int geoY, int worldZ) { - return getBlock(geoX, geoY).getHeightNearest(geoX, geoY, worldZ); + final ABlock block = getBlock(geoX, geoY); + return block != null ? block.getHeightNearest(geoX, geoY, worldZ) : (short) worldZ; } /** @@ -327,7 +328,8 @@ public class GeoEngine */ public final short getHeightNearestOriginal(int geoX, int geoY, int worldZ) { - return getBlock(geoX, geoY).getHeightNearestOriginal(geoX, geoY, worldZ); + final ABlock block = getBlock(geoX, geoY); + return block != null ? block.getHeightNearestOriginal(geoX, geoY, worldZ) : (short) worldZ; } /** @@ -339,7 +341,8 @@ public class GeoEngine */ public final byte getNsweNearest(int geoX, int geoY, int worldZ) { - return getBlock(geoX, geoY).getNsweNearest(geoX, geoY, worldZ); + final ABlock block = getBlock(geoX, geoY); + return block != null ? block.getNsweNearest(geoX, geoY, worldZ) : (byte) 0xFF; } /** @@ -352,7 +355,8 @@ public class GeoEngine */ public final byte getNsweNearestOriginal(int geoX, int geoY, int worldZ) { - return getBlock(geoX, geoY).getNsweNearestOriginal(geoX, geoY, worldZ); + final ABlock block = getBlock(geoX, geoY); + return block != null ? block.getNsweNearestOriginal(geoX, geoY, worldZ) : (byte) 0xFF; } /** diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java index ea34ff723b..d348339145 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -67,7 +67,7 @@ public class GeoEngine } /** - * GeoEngine contructor. Loads all geodata files of chosen geodata format. + * GeoEngine constructor. Loads all geodata files of chosen geodata format. */ public GeoEngine() { @@ -314,7 +314,8 @@ public class GeoEngine */ public final short getHeightNearest(int geoX, int geoY, int worldZ) { - return getBlock(geoX, geoY).getHeightNearest(geoX, geoY, worldZ); + final ABlock block = getBlock(geoX, geoY); + return block != null ? block.getHeightNearest(geoX, geoY, worldZ) : (short) worldZ; } /** @@ -327,7 +328,8 @@ public class GeoEngine */ public final short getHeightNearestOriginal(int geoX, int geoY, int worldZ) { - return getBlock(geoX, geoY).getHeightNearestOriginal(geoX, geoY, worldZ); + final ABlock block = getBlock(geoX, geoY); + return block != null ? block.getHeightNearestOriginal(geoX, geoY, worldZ) : (short) worldZ; } /** @@ -339,7 +341,8 @@ public class GeoEngine */ public final byte getNsweNearest(int geoX, int geoY, int worldZ) { - return getBlock(geoX, geoY).getNsweNearest(geoX, geoY, worldZ); + final ABlock block = getBlock(geoX, geoY); + return block != null ? block.getNsweNearest(geoX, geoY, worldZ) : (byte) 0xFF; } /** @@ -352,7 +355,8 @@ public class GeoEngine */ public final byte getNsweNearestOriginal(int geoX, int geoY, int worldZ) { - return getBlock(geoX, geoY).getNsweNearestOriginal(geoX, geoY, worldZ); + final ABlock block = getBlock(geoX, geoY); + return block != null ? block.getNsweNearestOriginal(geoX, geoY, worldZ) : (byte) 0xFF; } /** diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java index 6117512fc9..9b0eb6719a 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -65,7 +65,7 @@ public class GeoEngine } /** - * GeoEngine contructor. Loads all geodata files of chosen geodata format. + * GeoEngine constructor. Loads all geodata files of chosen geodata format. */ public GeoEngine() { @@ -312,7 +312,8 @@ public class GeoEngine */ public final short getHeightNearest(int geoX, int geoY, int worldZ) { - return getBlock(geoX, geoY).getHeightNearest(geoX, geoY, worldZ); + final ABlock block = getBlock(geoX, geoY); + return block != null ? block.getHeightNearest(geoX, geoY, worldZ) : (short) worldZ; } /** @@ -325,7 +326,8 @@ public class GeoEngine */ public final short getHeightNearestOriginal(int geoX, int geoY, int worldZ) { - return getBlock(geoX, geoY).getHeightNearestOriginal(geoX, geoY, worldZ); + final ABlock block = getBlock(geoX, geoY); + return block != null ? block.getHeightNearestOriginal(geoX, geoY, worldZ) : (short) worldZ; } /** @@ -337,7 +339,8 @@ public class GeoEngine */ public final byte getNsweNearest(int geoX, int geoY, int worldZ) { - return getBlock(geoX, geoY).getNsweNearest(geoX, geoY, worldZ); + final ABlock block = getBlock(geoX, geoY); + return block != null ? block.getNsweNearest(geoX, geoY, worldZ) : (byte) 0xFF; } /** @@ -350,7 +353,8 @@ public class GeoEngine */ public final byte getNsweNearestOriginal(int geoX, int geoY, int worldZ) { - return getBlock(geoX, geoY).getNsweNearestOriginal(geoX, geoY, worldZ); + final ABlock block = getBlock(geoX, geoY); + return block != null ? block.getNsweNearestOriginal(geoX, geoY, worldZ) : (byte) 0xFF; } /** diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java index ea34ff723b..d348339145 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -67,7 +67,7 @@ public class GeoEngine } /** - * GeoEngine contructor. Loads all geodata files of chosen geodata format. + * GeoEngine constructor. Loads all geodata files of chosen geodata format. */ public GeoEngine() { @@ -314,7 +314,8 @@ public class GeoEngine */ public final short getHeightNearest(int geoX, int geoY, int worldZ) { - return getBlock(geoX, geoY).getHeightNearest(geoX, geoY, worldZ); + final ABlock block = getBlock(geoX, geoY); + return block != null ? block.getHeightNearest(geoX, geoY, worldZ) : (short) worldZ; } /** @@ -327,7 +328,8 @@ public class GeoEngine */ public final short getHeightNearestOriginal(int geoX, int geoY, int worldZ) { - return getBlock(geoX, geoY).getHeightNearestOriginal(geoX, geoY, worldZ); + final ABlock block = getBlock(geoX, geoY); + return block != null ? block.getHeightNearestOriginal(geoX, geoY, worldZ) : (short) worldZ; } /** @@ -339,7 +341,8 @@ public class GeoEngine */ public final byte getNsweNearest(int geoX, int geoY, int worldZ) { - return getBlock(geoX, geoY).getNsweNearest(geoX, geoY, worldZ); + final ABlock block = getBlock(geoX, geoY); + return block != null ? block.getNsweNearest(geoX, geoY, worldZ) : (byte) 0xFF; } /** @@ -352,7 +355,8 @@ public class GeoEngine */ public final byte getNsweNearestOriginal(int geoX, int geoY, int worldZ) { - return getBlock(geoX, geoY).getNsweNearestOriginal(geoX, geoY, worldZ); + final ABlock block = getBlock(geoX, geoY); + return block != null ? block.getNsweNearestOriginal(geoX, geoY, worldZ) : (byte) 0xFF; } /**