Better Ability Data Syncing

This commit is contained in:
Kam committed 2026-02-23 21:46:23 -05:00
1 parent a724f7f12c
commit 670b811e03
5 files changed
+93 -27

No files matched your search

@@ -10,6 +10,7 @@ import kamkeel.npcs.controllers.AbilityController;
import kamkeel.npcs.controllers.AttributeController;
import kamkeel.npcs.controllers.SyncController;
import kamkeel.npcs.controllers.data.ability.Ability;
import kamkeel.npcs.network.packets.data.ability.PlayerAbilitySyncPacket;
import kamkeel.npcs.controllers.data.ability.enums.AbilityPhase;
import kamkeel.npcs.util.AttributeAttackUtil;
import net.minecraft.entity.Entity;
@@ -142,8 +143,16 @@ public class ScriptPlayerEventHandler {
playerData.timers.update();
}
if (player.ticksExisted % 10 == 0)
SyncController.syncEffects((EntityPlayerMP) player);
if (player.ticksExisted % 10 == 0) {
EntityPlayerMP mp = (EntityPlayerMP) player;
SyncController.syncEffects(mp);
SyncController.syncAbilityCooldowns(mp);
if (playerData.abilityData.needsSync) {
PlayerAbilitySyncPacket.sendToPlayer(mp);
playerData.abilityData.needsSync = false;
}
playerData.abilityData.ensureLockStateClear();
}
if (player.ticksExisted % 10 == 0)
CustomEffectController.Instance.runEffects(player);