Ars Nouveau

Ars Nouveau

49M Downloads

EntityFollowProjectile modifies ArrowEntity data manager

stepsword opened this issue ยท 4 comments

commented
[24May2021 19:14:28.603] [Server thread/WARN] [net.minecraft.network.datasync.EntityDataManager/]: defineId called for: class net.minecraft.entity.projectile.ArrowEntity from class com.hollingsworth.arsnouveau.common.entity.EntityFollowProjectile
[24May2021 19:14:28.604] [Server thread/WARN] [net.minecraft.network.datasync.EntityDataManager/]: defineId called for: class net.minecraft.entity.projectile.ArrowEntity from class com.hollingsworth.arsnouveau.common.entity.EntityFollowProjectile

Sorry, I hit enter too early - so it seems like on servers, Ars is adding stuff to all arrows. But, this doesn't seem to also happen on the client side. When I print IDs in the Data Manager, my custom arrow's ids start at 12 on the server side, but they start at 10 on the client side, which basically kills the data manager's usability as it compares ids when receiving updates on the client side. Removing Ars (and Reliquary which is also doing something similar) fixes this.

commented

Hello Stepsword,
I am not quite sure what this means, to my knowledge, I am simply extending the arrow class, not mutating all arrows.
The class is here: https://github.com/baileyholl/Ars-Nouveau/blob/1.16.2/src/main/java/com/hollingsworth/arsnouveau/common/entity/EntityFollowProjectile.java

Is there something that stands out here? I am more than happy to change it if needed, and truthfully these don't even need to extend ArrowEntity at all at the end of the day.

commented

Yea, so these two lines:

    public static final DataParameter<BlockPos> to = EntityDataManager.defineId(ArrowEntity.class, DataSerializers.BLOCK_POS);
    public static final DataParameter<BlockPos> from = EntityDataManager.defineId(ArrowEntity.class, DataSerializers.BLOCK_POS);

create a new data manager ID for all arrows that extend ArrowEntity, because you have ArrowEntity.class there, to my understanding. I think if you don't need "to" and "from" to be tracked across all arrows, you can just replace those two ArrowEntity.class with EntityFollowProjectile.class.

I'm not really sure why declaring these only makes these on the server, but that was the behavior I was observing when iterating over the data manager and printing everything out.

Basically I'd get on the server:
1 - vanilla thing
2 - vanilla thing
...
9 - vanilla thing
12+ - mahou things

And on the client:
1 - vanilla thing
2 - vanilla thing
...
9 - vanilla thing
10+ - mahou things

So basically it seems like just declaring those things with that class increments the ID values for that class, but for some reason it's only happening on the server.

commented

Ah I see, good catch!

Should be fixed now, sorry about that.

commented

no worries! thanks for fixing it