So while debugging a few things, I think I've found out why the Ender affinity ability: Relocation's cooldown doesn't work properly atm, as well as exploits around it.
Currently the code around cooldowns (and more specifically the affinity abilities) seem to be a hell of a mess in regards to client vs server side (stuff like if (!world.isRemote) inside of keyPresses event handlers, only called on client).
From what I've seen the cooldown only gets set on the client when using the ability (thus no check is done on the server, leaves it open for exploits), however the cooldowns only get reduced on serverside in LivingTickEvent (with a if (world.isRemote) check).
My opinion: these parts could benefit greatly from getting rewritten (or cleaned up massively)
There seems to be a huge mess with many capabilities cross-referencing each others etc.
The "authorization checks" (like cooldowns) should be handled serverside, to prevent modified clients from cheating (could be replicated to client to allow for cooldown rendering for example).
Client-only methods shouldn't attempt to call serversided code.
As a temporary fix (until the above are resolved), removing the if (!event.getEntityLiving().world.isRemote) check in the onPlayerTick method in am2.affinity.AffinityAbilityHelper works, as that will let the client count the cooldown properly.
I might end up working on some of the above later if I get the chance, but if anyone wants to kick in... Please do! (I'm working on many other projects atm...)
So while debugging a few things, I think I've found out why the Ender affinity ability: Relocation's cooldown doesn't work properly atm, as well as exploits around it. Currently the code around cooldowns (and more specifically the affinity abilities) seem to be a hell of a mess in regards to client vs server side (stuff like
if (!world.isRemote)
inside of keyPresses event handlers, only called on client). From what I've seen the cooldown only gets set on the client when using the ability (thus no check is done on the server, leaves it open for exploits), however the cooldowns only get reduced on serverside in LivingTickEvent (with aif (world.isRemote)
check).My opinion: these parts could benefit greatly from getting rewritten (or cleaned up massively)
As a temporary fix (until the above are resolved), removing the
if (!event.getEntityLiving().world.isRemote)
check in theonPlayerTick
method inam2.affinity.AffinityAbilityHelper
works, as that will let the client count the cooldown properly.I might end up working on some of the above later if I get the chance, but if anyone wants to kick in... Please do! (I'm working on many other projects atm...)