Fix Tag serializing empty optionals, improve RegistryObject error msg

This commit is contained in:
tterrag 2020-04-05 00:45:59 -04:00
parent 25605505d5
commit cf9b1b2193
2 changed files with 2 additions and 2 deletions

View File

@ -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;
}

View File

@ -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;
}