mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 19:39:22 +00:00
Fix Tag serializing empty optionals, improve RegistryObject error msg
This commit is contained in:
1 parent
25605505d5
commit
cf9b1b2193
2 files changed
+2
-2
No files matched your search
@@ -34,7 +34,7 @@
|
||||
- jsonobject.addProperty("replace", false);
|
||||
+ jsonobject.addProperty("replace", replace);
|
||||
jsonobject.add("values", jsonarray);
|
||||
+ jsonobject.add("optional", optional);
|
||||
+ if (optional.size() > 0) jsonobject.add("optional", optional);
|
||||
return jsonobject;
|
||||
}
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ public final class RegistryObject<T extends IForgeRegistryEntry<? super T>> impl
|
||||
public T get()
|
||||
{
|
||||
T ret = this.value;
|
||||
Objects.requireNonNull(ret, "Registry Object not present");
|
||||
Objects.requireNonNull(ret, () -> "Registry Object not present: " + this.name);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user