Sponge: Listeners GameRegistryEvent.Register<DataTranslator<?>> never calling

Created on 3 Jan 2019  路  6Comments  路  Source: SpongePowered/Sponge

I am currently running

  • SpongeVanilla version: spongevanilla-1.12.2-7.1.4
  • Java version: OpenJDK 1.8.0_181
  • Operating System: Kubuntu 18.04
  • Plugins/Mods: Only one experimental plugin

Issue Description

Listeners GameRegistryEvent.Register<DataTranslator<?>> never calling and impossible to register correctly DataTranslators.

accepted data bug

Most helpful comment

I need to serialize to DataContainer instances of a regular class that is not associated with Data API. DataTranslator is best suited for this. It is very important that this happens automatically when calling the appropriate methods in DataView class. Why then need DataManager#registerTranslator() method? The fact that the event is not triggered is more like a bug.

All 6 comments

I need to serialize to DataContainer instances of a regular class that is not associated with Data API. DataTranslator is best suited for this. It is very important that this happens automatically when calling the appropriate methods in DataView class. Why then need DataManager#registerTranslator() method? The fact that the event is not triggered is more like a bug.

For now use the DataManager#registerTranslator() method, I will fix it when I have the time.

There is another problem... Work of methods DataManager#registryTranslator() and GameRegistryEvent.Register#register() somewhat different. When registering a DataTranslator with GameRegistryEvent.Register#register() then methods DataView#getObject() and DataView#getObjectList() can't get data translator.

In practice, it is not yet possible to test, due to the bug described above.

I made a small image illustrating this:
Registering of DataTranslator

Yes, I already noticed that the two methods are currently doing different things.

@Lignium The event should work now as expected.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

XakepSDK picture XakepSDK  路  3Comments

XakepSDK picture XakepSDK  路  4Comments

jeffreykog picture jeffreykog  路  4Comments

XakepSDK picture XakepSDK  路  5Comments

gabizou picture gabizou  路  5Comments