Skip to content

Commit

Permalink
Fix DimensionManager crash part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
miozune committed Dec 11, 2022
1 parent 5d4d901 commit b56c693
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
3 changes: 3 additions & 0 deletions addon.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
compileJava {
options.encoding = "UTF-8"
}
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,9 @@ public static HashMap<String, Integer> getArrayOfPossibleDimensionsAgain(int tie
public static void unregisterSpaceStations() {
if (WorldUtil.registeredSpaceStations != null) {
for (final Integer registeredID : WorldUtil.registeredSpaceStations.keySet()) {
DimensionManager.unregisterDimension(registeredID);
if (DimensionManager.isDimensionRegistered(registeredID)) {
DimensionManager.unregisterDimension(registeredID);
}
}

WorldUtil.registeredSpaceStations = null;
Expand Down Expand Up @@ -755,10 +757,10 @@ public static boolean registerPlanet(int planetID, boolean initialiseDimensionAt
public static void unregisterPlanets() {
if (WorldUtil.registeredPlanets != null) {
for (final Integer var1 : WorldUtil.registeredPlanets) {
try {
if (DimensionManager.isDimensionRegistered(var1)) {
DimensionManager.unregisterDimension(var1);
GCLog.info("Unregistered Dimension: " + var1);
} catch (final IllegalArgumentException e) {
} else {
GCLog.info("Unregistered Dimension: " + var1 + " - already unregistered");
}
}
Expand Down Expand Up @@ -1318,7 +1320,9 @@ public static void decodePlanetsListClient(List<Object> data) {
}
if (WorldUtil.registeredPlanets != null) {
for (final Integer registeredID : WorldUtil.registeredPlanets) {
DimensionManager.unregisterDimension(registeredID);
if (DimensionManager.isDimensionRegistered(registeredID)) {
DimensionManager.unregisterDimension(registeredID);
}
}
}
WorldUtil.registeredPlanets = new ArrayList<>();
Expand Down Expand Up @@ -1391,7 +1395,9 @@ public static void decodeSpaceStationListClient(List<Object> data) {
try {
if (WorldUtil.registeredSpaceStations != null) {
for (final Integer registeredID : WorldUtil.registeredSpaceStations.keySet()) {
DimensionManager.unregisterDimension(registeredID);
if (DimensionManager.isDimensionRegistered(registeredID)) {
DimensionManager.unregisterDimension(registeredID);
}
}
}
WorldUtil.registeredSpaceStations = Maps.newHashMap();
Expand Down

0 comments on commit b56c693

Please sign in to comment.