Fix Tag serializing empty optionals, improve RegistryObject error msg
This commit is contained in:
parent
25605505d5
commit
cf9b1b2193
2 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue