Fixed an NPE caused by missing registries. (#6292)

Missing registries in this case being registries renamed without proper remapping or created by mods that were removed.
This commit is contained in:
DaemonUmbra 2019-11-05 14:10:32 -05:00 committed by LexManos
parent 7f8b30aed3
commit f4a85e5f03

View file

@ -87,12 +87,13 @@ public class RegistryManager
public <V extends IForgeRegistryEntry<V>> ResourceLocation updateLegacyName(ResourceLocation legacyName) public <V extends IForgeRegistryEntry<V>> ResourceLocation updateLegacyName(ResourceLocation legacyName)
{ {
ResourceLocation originalName = legacyName;
while (getRegistry(legacyName) == null) while (getRegistry(legacyName) == null)
{ {
legacyName = legacyNames.get(legacyName); legacyName = legacyNames.get(legacyName);
if (legacyName == null) if (legacyName == null)
{ {
return null; return originalName;
} }
} }
return legacyName; return legacyName;