Tamaized / AoV

A Healing Based Magic Minecraft Mod
https://minecraft.curseforge.com/projects/angel-of-vengeance
MIT License
15 stars 10 forks source link

AoV invalidates all capabilities on player clone #146

Closed maxanier closed 4 years ago

maxanier commented 4 years ago

AoV uses reflection to make sure the player's capability provider is valid upon PlayerClone. After copying its own capabilities, it invalidates the provider (regardless of its previous state): https://github.com/Tamaized/AoV/blob/ae514b39463d4b8a471c10c5bdd86df2e47af3dc/src/main/java/tamaized/aov/common/capabilities/CapabilityList.java#L198

However, the provider is originally valid, so the code is not only unnecessary, but also breaks other mods like Vampirism: https://github.com/TeamLapen/Vampirism/issues/577

I think in early Forge 1.14, the provider was originally invalid, which is probably the reason for your code, but that is fixed for some time now (https://github.com/MinecraftForge/MinecraftForge/pull/5728). At least I did not have any issues with this since then.

If you still want to keep that code, please make sure to set valid to the original value instead of false.