Fixed a player login issue with ASkills

This commit is contained in:
Indyuce 2022-02-19 10:28:02 +01:00
parent b35a651c6d
commit 4dac3c1445
2 changed files with 5 additions and 1 deletions

View File

@ -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.
*

View File

@ -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());