Try to fix #256 again

This commit is contained in:
shedaniel
2022-05-09 00:04:17 +08:00
parent 476cea2aff
commit fbb1868c0e

View File

@@ -171,12 +171,12 @@ public class RegistriesImpl {
if (registry == null) {
Registry<T> ts = (Registry<T>) Registry.REGISTRY.get(registryKey.location());
if (ts == null) ts = (Registry<T>) BuiltinRegistries.REGISTRY.get(registryKey.location());
if (ts == null) ts = (Registry<T>) RegistryProviderImpl.CUSTOM_REGS.get(registryKey);
if (ts == null) {
throw new IllegalArgumentException("Registry " + registryKey + " does not exist!");
} else {
if (ts != null) {
return get(ts);
}
Registrar<?> customReg = RegistryProviderImpl.CUSTOM_REGS.get(registryKey);
if (customReg != null) return (Registrar<T>) customReg;
throw new IllegalArgumentException("Registry " + registryKey + " does not exist!");
}
return get(registry);
}