From f4a85e5f036a44d1d6aa68ec13354710707e7474 Mon Sep 17 00:00:00 2001 From: DaemonUmbra Date: Tue, 5 Nov 2019 14:10:32 -0500 Subject: [PATCH] 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. --- .../java/net/minecraftforge/registries/RegistryManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minecraftforge/registries/RegistryManager.java b/src/main/java/net/minecraftforge/registries/RegistryManager.java index 45203a700..6957c8352 100644 --- a/src/main/java/net/minecraftforge/registries/RegistryManager.java +++ b/src/main/java/net/minecraftforge/registries/RegistryManager.java @@ -87,12 +87,13 @@ public class RegistryManager public > ResourceLocation updateLegacyName(ResourceLocation legacyName) { + ResourceLocation originalName = legacyName; while (getRegistry(legacyName) == null) { legacyName = legacyNames.get(legacyName); if (legacyName == null) { - return null; + return originalName; } } return legacyName;