Atmospheric

Atmospheric

22M Downloads

[1.12.1} Initializing Error causing Modpack to not start

Skaphegor opened this issue ยท 2 comments

commented

I have an continious error in Atmospheric that prevents my modpack from starting.

It seems to be caused by the new Camel: https://pastebin.com/DvSfmhqg

Full log: https://pastebin.com/hAHa5Cmt

commented

This is due to classloading hell.

To start, Sinytra Connector loads Fabric mods before NeoForge mods - I'm sure they have a good reason for doing it like that, but I don't recall what it was.

Any Fabric mod that registers an EntityType or otherwise interacts with entity attributes will classload DefaultAttributes. In turn, this class will classload every vanilla entity class - notably, including Camel.

Atmospheric's CamelMixin (indirectly) injects a call to AtmosphericDataSerializers.CAMEL_VARIANT.get() into Camel's static class initializer (a.k.a. <clinit>). However, if this getter is invoked before NeoForge mods can initialize - as tends to happen with Fabric mods, as described above - AtmosphericDataSerializers.CAMEL_VARIANT will not be registered yet, thus causing the game to crash.

@Unique
private static final EntityDataAccessor<Holder<CamelVariant>> DATA_VARIANT_ID = SynchedEntityData.defineId(Camel.class, AtmosphericDataSerializers.CAMEL_VARIANT.get());

For the record - it's strongly recommended not to add SynchedEntityData to existing entities via mixin. This is due to mixin injection order being indeterminate, causing desyncs if two or more mixins that modify the same entity's SynchedEntityData load in a different order between the client and server.

I believe the recommended alternative is NeoForge's Data Attachments.

commented

I removed the Connector and the related Fabric mods. but I run into the same issue though

https://pastebin.com/77FmuQT7