From 4dac3c14451c6699b3ab77c5fc845d1d835f28d5 Mon Sep 17 00:00:00 2001 From: Indyuce Date: Sat, 19 Feb 2022 10:28:02 +0100 Subject: [PATCH] Fixed a player login issue with ASkills --- .../java/net/Indyuce/mmoitems/api/player/EmptyRPGPlayer.java | 2 +- .../net/Indyuce/mmoitems/comp/rpg/AureliumSkillsHook.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/Indyuce/mmoitems/api/player/EmptyRPGPlayer.java b/src/main/java/net/Indyuce/mmoitems/api/player/EmptyRPGPlayer.java index ed2f9b69..e37b2cc2 100644 --- a/src/main/java/net/Indyuce/mmoitems/api/player/EmptyRPGPlayer.java +++ b/src/main/java/net/Indyuce/mmoitems/api/player/EmptyRPGPlayer.java @@ -1,7 +1,7 @@ package net.Indyuce.mmoitems.api.player; /** - * Temporarily used by MMOItems when plugins like AureliumSkills don't laod player + * Temporarily used by MMOItems when plugins like AureliumSkills don't load player * data right on player startup, which means the player data instance can't * directly be cached by MMOItems. * diff --git a/src/main/java/net/Indyuce/mmoitems/comp/rpg/AureliumSkillsHook.java b/src/main/java/net/Indyuce/mmoitems/comp/rpg/AureliumSkillsHook.java index 0ff5d8ce..bef63981 100644 --- a/src/main/java/net/Indyuce/mmoitems/comp/rpg/AureliumSkillsHook.java +++ b/src/main/java/net/Indyuce/mmoitems/comp/rpg/AureliumSkillsHook.java @@ -9,6 +9,7 @@ import com.archyx.aureliumskills.skills.Skills; import com.archyx.aureliumskills.stats.Stats; import io.lumine.mythic.lib.api.item.NBTItem; import io.lumine.mythic.lib.version.VersionMaterial; +import io.lumine.utils.metadata.Empty; import net.Indyuce.mmoitems.MMOItems; import net.Indyuce.mmoitems.api.player.EmptyRPGPlayer; import net.Indyuce.mmoitems.api.player.PlayerData; @@ -130,6 +131,9 @@ public class AureliumSkillsHook implements RPGHandler, Listener { @Override public boolean canUse(RPGPlayer player, NBTItem item, boolean message) { + if (!(player instanceof AureliumSkillsPlayer)) + return false; + int skillLevel = ((AureliumSkillsPlayer) player).info.getSkillLevel(skill); int required = item.getInteger("MMOITEMS_REQUIRED_" + skill.name());