Skip to content

Commit

Permalink
Fix error when handling empty legacy registries
Browse files Browse the repository at this point in the history
  • Loading branch information
booky10 committed Aug 20, 2024
1 parent f4bb1dd commit a3f2232
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@ public static void handleLegacyRegistries(
for (NBT tag : registryData.getTags().values()) {
NBTCompound compound = (NBTCompound) tag;
// extract registry name
ResourceLocation registryName = new ResourceLocation(
compound.getStringTagValueOrThrow("type"));
ResourceLocation registryName = new ResourceLocation(compound.getStringTagValueOrThrow("type"));
// extract registry entries
NBTList<NBTCompound> nbtElements =
compound.getCompoundListTagOrThrow("value");
// store registry elements
handleRegistry(user, version, registryName,
RegistryElement.convertNbt(nbtElements), cacheKey);
NBTList<NBTCompound> nbtElements = compound.getCompoundListTagOrNull("value");
if (nbtElements != null) {
// store registry elements
handleRegistry(user, version, registryName,
RegistryElement.convertNbt(nbtElements), cacheKey);
}
}
}

Expand Down

0 comments on commit a3f2232

Please sign in to comment.