ResourcefulCrops

ResourcefulCrops

173k Downloads

Allow seed JSON to have "color" :null

OrdinatorStouff opened this issue ยท 1 comments

commented

https://github.com/TehNut/ResourcefulCrops/blob/1.12/src/main/java/tehnut/resourceful/crops/core/json/Serializers.java#L51

I am generating my seed JSONs programmatically and some I might specify a color and some not. It would be helpful to be able to have the color node present but set to null for the seeds that I do not want to specify a color otherwise I will have to manually edit the final seed jsons to take that out.

This is minor and not necessary but a simple suggestion nonetheless.

Thank you.

commented

To add, this is the top part of the error in the log if I do have a json with "color": null

java.lang.UnsupportedOperationException: JsonNull
	at com.google.gson.JsonElement.getAsString(JsonElement.java:191)
	at tehnut.resourceful.crops.core.json.Serializers$1.deserialize(Serializers.java:51)
	at tehnut.resourceful.crops.core.json.Serializers$1.deserialize(Serializers.java:40)