Profile + Effect Loading

This commit is contained in:
Kam committed 2025-02-19 00:21:40 -05:00
1 parent e8f657f7e6
commit 5a38f9057f
9 files changed
+354 -139

No files matched your search

@@ -17,6 +17,7 @@ import noppes.npcs.api.entity.ICustomNpc;
import noppes.npcs.api.handler.*;
import noppes.npcs.config.ConfigMain;
import noppes.npcs.constants.EnumRoleType;
import noppes.npcs.controllers.CustomEffectController;
import noppes.npcs.controllers.PartyController;
import noppes.npcs.controllers.PlayerDataController;
import noppes.npcs.entity.EntityCustomNpc;
@@ -71,7 +72,7 @@ public class PlayerData implements IExtendedEntityProperties, IPlayerData {
public int profileSlot = 0;
public void onLogin() {
//Continue playing animation for self when re-logging
// Continue playing animation for self when re-logging
AnimationData animationData = this.animationData;
if (animationData != null && animationData.isClientAnimating()) {
Animation currentAnimation = animationData.currentClientAnimation;
@@ -79,6 +80,13 @@ public class PlayerData implements IExtendedEntityProperties, IPlayerData {
animationData.viewAnimation(currentAnimation, animationData, compound,
animationData.isClientAnimating(), currentAnimation.currentFrame, currentAnimation.currentFrameTime);
}
CustomEffectController controller = CustomEffectController.getInstance();
UUID playerID = player.getPersistentID();
// Only add if there are saved effects and none are registered yet.
if (!controller.playerEffects.containsKey(playerID)) {
controller.playerEffects.put(playerID, effectData.getEffects());
}
}
public void onLogout() {