Tick Attribute Tracker

This commit is contained in:
Kam committed 2025-02-25 16:46:05 -05:00
1 parent 0c1ce7ed7a
commit f1b77fe94f
4 files changed
+9 -36

No files matched your search

@@ -23,6 +23,7 @@ import net.minecraftforge.event.entity.player.*;
import net.minecraftforge.event.world.BlockEvent;
import noppes.npcs.api.entity.IPlayer;
import noppes.npcs.api.item.IItemCustomizable;
import noppes.npcs.attribute.PlayerAttributeManager;
import noppes.npcs.constants.EnumQuestType;
import noppes.npcs.controllers.CustomEffectController;
import noppes.npcs.controllers.PartyController;
@@ -47,7 +48,7 @@ public class ScriptPlayerEventHandler {
if (event.side == Side.SERVER && event.phase == TickEvent.Phase.START) {
EntityPlayer player = event.player;
if (player.ticksExisted%10 == 0) {
if (player.ticksExisted % 10 == 0) {
PlayerDataScript handler = ScriptController.Instance.playerScripts;
IPlayer scriptPlayer = (IPlayer) NpcAPI.Instance().getIEntity(player);
EventHooks.onPlayerTick(handler, scriptPlayer);
@@ -59,6 +60,8 @@ public class ScriptPlayerEventHandler {
EventHooks.onScriptItemUpdate(isw, player);
}
}
PlayerAttributeManager.getTracker(player.getUniqueID()).updateIfChanged(player);
}
if (PlayerDataController.Instance != null) {