#Error when deserializing an instance of a subclass of ItemStack

1 messages · Page 1 of 1 (latest)

wicked citrus
#

Hey, I made a PersistentDataType of a MerchantRecipe list and it's working when the results and ingredients for the merchant recipes are ItemStacks. But when I try to use it with a subclass of ItemStack an error is thrown: https://pastebin.com/zxCrjs3L . Here's my MerchantRecipeListDataType class: https://pastebin.com/jBv1qQ0M.

#

Here is the code for the subclass of ItemStack I'm trying to serialize/deserialize

swift remnant
#

did you register teh slimefun Item?

wicked citrus
#

yes

swift remnant
#

You shouldn't extend ItemStack

#

your Item doesn;t implement ConfigurationSerializable

wicked citrus
swift remnant
#

yes

wicked citrus
wicked citrus
swift remnant
#

it does, but your class doesn;t

#

you have no serialize nor deserialize method

#

First don't extend ItemStack. have a getter for it inside your class.

#

then your class must Implement and corectly register ConfigurationSerializable

wicked citrus
#

Any suggestions on how to solve it? Maybe a wrapper class? idk

swift remnant
#

no shortcut to make it serializable

wicked citrus
#

If anyone reads it in the future, I was able to fix it creating a class to wrap a slimefun item stack