diff --git a/server/src/server/worldgen/FeatureOres.java b/server/src/server/worldgen/FeatureOres.java index abac8a1..bd61fc6 100755 --- a/server/src/server/worldgen/FeatureOres.java +++ b/server/src/server/worldgen/FeatureOres.java @@ -5,6 +5,7 @@ import common.rng.Random; import common.util.BlockPos; import common.util.ExtMath; import common.world.State; +import common.world.World; import server.world.WorldServer; public class FeatureOres @@ -41,18 +42,18 @@ public class FeatureOres this.oreBlock = state; this.distributed = dist; if(this.distributed) { - min = min < 0 ? 0 : (min > 511 ? 511 : min); - max = max < 0 ? 0 : (max > 512 ? 512 : max); - if(min + max > 511) { - max = 512 - min; + min = min < -World.MAX_SIZE_Y ? -World.MAX_SIZE_Y : (min > World.MAX_SIZE_Y - 1 ? World.MAX_SIZE_Y - 1 : min); + max = max < -World.MAX_SIZE_Y ? -World.MAX_SIZE_Y : (max > World.MAX_SIZE_Y ? World.MAX_SIZE_Y : max); + if(min + max > World.MAX_SIZE_Y - 1) { + max = World.MAX_SIZE_Y - min; } if(min - max < 0) { max = min; } } else { - min = min < 0 ? 0 : (min > 512 ? 512 : min); - max = max < 0 ? 0 : (max > 512 ? 512 : max); + min = min < -World.MAX_SIZE_Y ? -World.MAX_SIZE_Y : (min > World.MAX_SIZE_Y ? World.MAX_SIZE_Y : min); + max = max < -World.MAX_SIZE_Y ? -World.MAX_SIZE_Y : (max > World.MAX_SIZE_Y ? World.MAX_SIZE_Y : max); if (max < min) { int i = min; @@ -61,7 +62,7 @@ public class FeatureOres } else if (max == min) { - if (min < 511) + if (min < World.MAX_SIZE_Y - 1) { ++max; }