diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/experience/source/PlayExperienceSource.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/experience/source/PlayExperienceSource.java index b2f49d62..ce55f600 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/experience/source/PlayExperienceSource.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/experience/source/PlayExperienceSource.java @@ -1,5 +1,6 @@ package net.Indyuce.mmocore.experience.source; +import io.lumine.mythic.lib.UtilityMethods; import io.lumine.mythic.lib.api.MMOLineConfig; import net.Indyuce.mmocore.MMOCore; import net.Indyuce.mmocore.api.player.PlayerData; @@ -21,7 +22,7 @@ public class PlayExperienceSource extends SpecificExperienceSource { /** * Experience source giving the specified amount of xp to all the players online each second in certain world bounds. - * If no bounds are given, it will give the xp to every player online. You can also specifiy if the player + * If no bounds are given, it will give the xp to every player online. You can also specify if the player * has to be inCombat or not to get the xp. */ public PlayExperienceSource(ExperienceDispenser dispenser, MMOLineConfig config) { @@ -71,13 +72,12 @@ public class PlayExperienceSource extends SpecificExperienceSource { @Override public void run() { - Bukkit.getOnlinePlayers().forEach((player) -> { - if (!player.hasMetadata("NPC")) { + Bukkit.getOnlinePlayers().forEach(player -> { + if (UtilityMethods.isRealPlayer(player)) { PlayerData playerData = PlayerData.get(player); - for (PlayExperienceSource source : getSources()) { + for (PlayExperienceSource source : getSources()) if (source.matchesParameter(playerData, null)) giveExperience(playerData, 1, null); - } } }); } diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/experience/source/RepairItemExperienceSource.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/experience/source/RepairItemExperienceSource.java index 3753f423..77ec54b0 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/experience/source/RepairItemExperienceSource.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/experience/source/RepairItemExperienceSource.java @@ -48,7 +48,7 @@ public class RepairItemExperienceSource extends ExperienceSource { @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void a(InventoryClickEvent event) { - if (event.getInventory() == null || event.getInventory().getType() != InventoryType.ANVIL || event.getSlot() != 2) + if (event.getInventory() == null || event.getInventory().getType() != InventoryType.ANVIL || event.getRawSlot() != 2) return; // Check if there's exp associated to it