Skip to content

Commit

Permalink
fix: defer namespaceid call to prevent memory explosion
Browse files Browse the repository at this point in the history
  • Loading branch information
mworzala committed May 7, 2024
1 parent f13e6fc commit efa3acd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main/java/net/hollowcube/polar/PolarReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,12 @@ private PolarReader() {
}
if (version <= PolarWorld.VERSION_SHORT_GRASS) {
for (int i = 0; i < blockPalette.length; i++) {
String strippedID = blockPalette[i].split("\\[")[0];
if (NamespaceID.from(strippedID).path().equals("grass"))
blockPalette[i] = "short_grass";
if (blockPalette[i].contains("grass")) {
String strippedID = blockPalette[i].split("\\[")[0];
if (NamespaceID.from(strippedID).path().equals("grass")) {
blockPalette[i] = "short_grass";
}
}
}
}
int[] blockData = null;
Expand Down

0 comments on commit efa3acd

Please sign in to comment.