Primitive Mobs

Primitive Mobs

10M Downloads

Crash because of EntityDataManager.createKey misusage

tyra314 opened this issue ยท 2 comments

commented

Please don't call EntityDataManager.createKey() for other classes.

See here:

protected static final DataParameter<Byte> TAMED = EntityDataManager.<Byte>createKey(EntityTameable.class, DataSerializers.BYTE);

That causes crashes and all kind of issues, like me not being able to play. ๐Ÿ˜ญ
For reference, here is the crash: AlexModGuy/Ice_and_Fire#460
and the issue at Forge: MinecraftForge/MinecraftForge#4743

commented

yep, the data manager is intended to only be used on a subtree of your own classes. Registering keys on other classes will break a ton of mods in a variety of ways.
If you look in the createKey method there's even a warning for this situation.

Those two lines should be changed to EntityPrimitiveTameableMob. If you need to attach this data to ALL tameables, then I recommend using entity capabilities and syncing them yourself.

commented

Yeh this is just an oversight. Sorry. Will fix and thanks for reporting!