Growlith1223 / ArsMagica2

Ars Magica 2 Bug Tracker
65 stars 31 forks source link

About the Ender Relocation (and other cooldown-based abilities) #288

Open Bluexin opened 7 years ago

Bluexin commented 7 years ago

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)

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...)