diff --git a/src/main/java/org/ultramine/server/util/WarpLocation.java b/src/main/java/org/ultramine/server/util/WarpLocation.java index 75c5e75..7c86f72 100644 --- a/src/main/java/org/ultramine/server/util/WarpLocation.java +++ b/src/main/java/org/ultramine/server/util/WarpLocation.java @@ -45,6 +45,8 @@ return this; WorldServer world = MinecraftServer.getServer().getMultiWorld().getWorldByID(dimension); + if(world == null) + return this; double newX = x + randomRadius*world.rand.nextDouble()*(world.rand.nextBoolean() ? -1 : 1); double newZ = z + randomRadius*world.rand.nextDouble()*(world.rand.nextBoolean() ? -1 : 1); double newY = y; @@ -57,6 +59,10 @@ while(world.getBlock(intX, MathHelper.floor_double(newY)-1, intZ) == Blocks.air) newY--; } + else + { + return this; + } return new WarpLocation(dimension, newX, newY, newZ, yaw, pitch, 0); }