Skip to content

Commit

Permalink
prevent crash when portal highlights enabled in non-vanilla dimensions
Browse files Browse the repository at this point in the history
  • Loading branch information
rfresh2 committed Oct 13, 2023
1 parent d07877c commit c469e67
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,9 @@ public ChunkHighlightCacheDimensionHandler getCacheForCurrentDimension() {
return overworldCache;
} else if (mcDimension.equals(END)) {
return endCache;
} else {
return null;
}
throw new RuntimeException("Unknown dimension: " + getActualDimension());
}

public ChunkHighlightCacheDimensionHandler getCacheForDimension(final RegistryKey<World> dimension) {
Expand All @@ -121,8 +122,9 @@ public ChunkHighlightCacheDimensionHandler getCacheForDimension(final RegistryKe
return overworldCache;
} else if (dimension.equals(END)) {
return endCache;
} else {
return null;
}
throw new RuntimeException("Unknown dimension: " + dimension);
}

private List<ChunkHighlightCacheDimensionHandler> getAllCaches() {
Expand All @@ -137,8 +139,9 @@ public List<ChunkHighlightCacheDimensionHandler> getCachesExceptDimension(final
return Stream.of(netherCache, endCache).filter(Objects::nonNull).collect(Collectors.toList());
} else if (dimension.equals(END)) {
return Stream.of(netherCache, overworldCache).filter(Objects::nonNull).collect(Collectors.toList());
} else {
return Collections.emptyList();
}
throw new RuntimeException("Unknown dimension: " + dimension);
}

private void initializeWorld() {
Expand Down

0 comments on commit c469e67

Please sign in to comment.