Fixed comp issue with ASkills

This commit is contained in:
Indyuce 2022-02-25 22:51:48 +01:00
parent cd75819c39
commit e43c1cfb89

View File

@ -9,7 +9,6 @@ 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;
@ -131,10 +130,8 @@ 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 skillLevel = player instanceof AureliumSkillsPlayer ? ((AureliumSkillsPlayer) player).info.getSkillLevel(skill) : 0;
int required = item.getInteger("MMOITEMS_REQUIRED_" + skill.name());
if (skillLevel < required && !player.getPlayer().hasPermission("mmoitems.bypass.level")) {