From 9d729dc6ae16ac5054361b371148fc25da14f038 Mon Sep 17 00:00:00 2001 From: PikaMug <2267126+PikaMug@users.noreply.github.com> Date: Mon, 8 Jul 2024 10:06:13 -0400 Subject: [PATCH] Check for objective before slots, fixes #2247 --- .../pikamug/quests/listeners/BukkitItemListener.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/me/pikamug/quests/listeners/BukkitItemListener.java b/core/src/main/java/me/pikamug/quests/listeners/BukkitItemListener.java index 970bff119..9cabcb42d 100644 --- a/core/src/main/java/me/pikamug/quests/listeners/BukkitItemListener.java +++ b/core/src/main/java/me/pikamug/quests/listeners/BukkitItemListener.java @@ -54,11 +54,6 @@ public class BukkitItemListener implements Listener { final Player player = (Player) event.getWhoClicked(); if (plugin.canUseQuests(player.getUniqueId())) { final ItemStack craftedItem = getCraftedItem(event); - if (BukkitInventoryUtil.getEmptySlots(player) - < craftedItem.getAmount() / craftedItem.getMaxStackSize()) { - event.setCancelled(true); - return; - } final Quester quester = plugin.getQuester(player.getUniqueId()); final ObjectiveType type = ObjectiveType.CRAFT_ITEM; final Set dispatchedQuestIDs = new HashSet<>(); @@ -69,6 +64,11 @@ public class BukkitItemListener implements Listener { if (quester.getCurrentQuests().containsKey(quest) && quester.getCurrentStage(quest).containsObjective(type)) { + if (BukkitInventoryUtil.getEmptySlots(player) + < craftedItem.getAmount() / craftedItem.getMaxStackSize()) { + event.setCancelled(true); + return; + } quester.craftItem(quest, craftedItem); }