Configurate ItemType-serializer

Hello!

I have problems when using my own ItemType-serializer. Configurate gives me this error.
I am registering my serializer here. The serializer is here. Even not registering and then using by default the Sponge CatalogTypeSerializer doesn’t work.
I think it is because of the mixins that add the ItemType interface to the nms-item but in the root the item is a ColoredItem in this example and can’t be serialized because of the fact that there is no serializer for ColoredItem.

Edit: Seems so, that my Location-serializer also doesn’t work. They all seem to not get registered. What am I doing wrong?

I don’t know Kotlin that well, but I expect that what you are doing in your ItemHologramSerializer is that you are using the method setValue(Object value) - which will be the problem because it’ll try to get the value using the class ItemColored, not ItemType.

Try using the method setValue(TypeToken.of(ItemType.class), value) on the line I’ve highlighted instead, to tell Configurate that you want to treat the object as an ItemType. Same with your Location<World>.

Hopefully that’ll solve your problem!

1 Like

Thanks!

15 chars…