[1.21.1] ModLoading cleanup and optimisations (#10052)

This commit is contained in:
Paint_Ninja authored and GitHub committed 2024-08-16 22:49:11 +01:00
1 parent f106ff0c21
commit 9714512c31
101 files changed
+837 -841

No files matched your search

@@ -26,7 +26,7 @@ public final class RegistryObject<T> implements Supplier<T> {
@Nullable
private final ResourceLocation name;
@Nullable
private ResourceKey<T> key;
private final ResourceKey<T> key;
private final boolean optionalRegistry;
@Nullable
private T value;
@@ -189,7 +189,8 @@ public final class RegistryObject<T> implements Supplier<T> {
@Override
public T get() {
T ret = this.value;
Objects.requireNonNull(ret, () -> "Registry Object not present: " + this.name);
if (ret == null)
throw new NullPointerException("Registry Object not present: " + this.name);
return ret;
}