Fixed /space command exception in unknown dimensions
This commit is contained in:
parent
7ce965917c
commit
4758df0c76
1 changed files with 6 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue