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:
parent
7f8b30aed3
commit
f4a85e5f03
|
@ -87,12 +87,13 @@ public class RegistryManager
|
|||
|
||||
public <V extends IForgeRegistryEntry<V>> ResourceLocation updateLegacyName(ResourceLocation legacyName)
|
||||
{
|
||||
ResourceLocation originalName = legacyName;
|
||||
while (getRegistry(legacyName) == null)
|
||||
{
|
||||
legacyName = legacyNames.get(legacyName);
|
||||
if (legacyName == null)
|
||||
{
|
||||
return null;
|
||||
return originalName;
|
||||
}
|
||||
}
|
||||
return legacyName;
|
||||
|
|
Loading…
Reference in New Issue