Fixed /space command exception in unknown dimensions

This commit is contained in:
LemADEC 2017-07-09 22:30:25 +02:00
parent 7ce965917c
commit 4758df0c76

View file

@ -166,6 +166,9 @@ public class StarMapRegistry {
public static int getSpaceDimensionId(final World world, final int x, final int z) {
CelestialObject celestialObject = getCelestialObject(world, x, z);
if (celestialObject == null) {
return world.provider.dimensionId;
}
// already in space?
if (celestialObject.isSpace()) {
return celestialObject.dimensionId;
@ -184,6 +187,9 @@ public class StarMapRegistry {
public static int getHyperspaceDimensionId(final World world, final int x, final int z) {
CelestialObject celestialObject = getCelestialObject(world, x, z);
if (celestialObject == null) {
return world.provider.dimensionId;
}
// already in hyperspace?
if (celestialObject.isHyperspace()) {
return celestialObject.dimensionId;