From 09ebde56761c60fcfe9204ae9c4ff5dd2ed3316b Mon Sep 17 00:00:00 2001 From: ASangarin Date: Wed, 9 Dec 2020 17:49:57 +0100 Subject: [PATCH] Fixes craftitem experience source providing XP when non-stackable is clicked --- .../api/experience/source/CraftItemExperienceSource.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/Indyuce/mmocore/api/experience/source/CraftItemExperienceSource.java b/src/main/java/net/Indyuce/mmocore/api/experience/source/CraftItemExperienceSource.java index fa7c085a..3cd7c88f 100644 --- a/src/main/java/net/Indyuce/mmocore/api/experience/source/CraftItemExperienceSource.java +++ b/src/main/java/net/Indyuce/mmocore/api/experience/source/CraftItemExperienceSource.java @@ -11,6 +11,7 @@ import net.Indyuce.mmocore.api.experience.source.type.SpecificExperienceSource; import net.Indyuce.mmocore.api.player.PlayerData; import net.Indyuce.mmocore.manager.profession.ExperienceManager; import net.mmogroup.mmolib.api.MMOLineConfig; +import org.bukkit.event.inventory.InventoryAction; public class CraftItemExperienceSource extends SpecificExperienceSource { public final Material material; @@ -25,9 +26,9 @@ public class CraftItemExperienceSource extends SpecificExperienceSource newManager() { return new ExperienceManager() { - - @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) + @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void a(CraftItemEvent event) { + if(event.getAction() == InventoryAction.NOTHING) return; PlayerData data = PlayerData.get((Player) event.getWhoClicked()); for (CraftItemExperienceSource source : getSources()) if (source.matches(data, event.getInventory().getResult().getType())) @@ -36,6 +37,10 @@ public class CraftItemExperienceSource extends SpecificExperienceSource