mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 23:55:10 +00:00
Fix Death Ability Bug
This commit is contained in:
1 parent
9f8f742a0e
commit
e5fc58366b
2 files changed
+52
-16
No files matched your search
@@ -650,10 +650,12 @@ public class ScriptPlayerEventHandler {
|
||||
return;
|
||||
|
||||
if (event.player.worldObj instanceof WorldServer && event.player instanceof EntityPlayerMP) {
|
||||
// Cancel any executing ability on respawn
|
||||
// Reset ability state for reconstructed entity and re-sync to client.
|
||||
// The death handler already interrupted the ability (with events/cooldowns),
|
||||
// so this just cleans up transient state and syncs the new entity.
|
||||
PlayerData playerData = PlayerData.get(event.player);
|
||||
if (playerData != null) {
|
||||
playerData.abilityData.interruptCurrentAbility();
|
||||
playerData.abilityData.resetOnRespawn();
|
||||
}
|
||||
|
||||
PlayerDataScript handler = ScriptController.Instance.getPlayerScripts(event.player);
|
||||
|
||||
Reference in new issue
Block a user