Terasology / Behaviors

Store for an assortment of behaviors that can be applied to creatures
https://terasology.github.io/Behaviors
6 stars 18 forks source link

deserialization error with SetTargetToNearbyBlockNode #109

Open keturn opened 2 years ago

keturn commented 2 years ago

While loading a game, I see an error:

ERROR o.t.e.u.gson.UriTypeAdapterFactory - URI type interface org.terasology.engine.core.Uri lacks String constructor

From peeking at variables in the stack trace, it seems this is coming from trying to figure out SetTargetToNearbyBlock during Terasology's LoadPrefabs step, and I think it's because gson is trying to figure out what to do with STTNB.movementPluginSystem. (because PluginSystem has a field with Map<Uri, Function<>>)

Should that field be marked transient? Or should something in BehaviorTreeFormat or BehaviorTreeBuilder know that fields marked @In should be skipped, since they expect to be handled by runtime dependency injection and not serialized data?

keturn commented 2 years ago

Oh, this maybe only happens on my experimental branch, in which case it might not be the module's fault. But it would be very useful to know the answer regardless.