From 10880e8a2edb45aa9edd9348ad42b6a881562608 Mon Sep 17 00:00:00 2001 From: PikaMug <2267126+PikaMug@users.noreply.github.com> Date: Tue, 9 Jul 2024 00:42:25 -0400 Subject: [PATCH] Inform lack of crafting space, see #2247 --- .../java/me/pikamug/quests/listeners/BukkitItemListener.java | 5 +++++ core/src/main/resources/strings.yml | 1 + 2 files changed, 6 insertions(+) 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 9cabcb42d..e3aa606b6 100644 --- a/core/src/main/java/me/pikamug/quests/listeners/BukkitItemListener.java +++ b/core/src/main/java/me/pikamug/quests/listeners/BukkitItemListener.java @@ -12,9 +12,12 @@ package me.pikamug.quests.listeners; import me.pikamug.quests.BukkitQuestsPlugin; import me.pikamug.quests.enums.ObjectiveType; +import me.pikamug.quests.nms.BukkitActionBarProvider; import me.pikamug.quests.player.Quester; import me.pikamug.quests.quests.Quest; import me.pikamug.quests.util.BukkitInventoryUtil; +import me.pikamug.quests.util.BukkitLang; +import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -66,6 +69,8 @@ public class BukkitItemListener implements Listener { && quester.getCurrentStage(quest).containsObjective(type)) { if (BukkitInventoryUtil.getEmptySlots(player) < craftedItem.getAmount() / craftedItem.getMaxStackSize()) { + BukkitActionBarProvider.sendActionBar(player, ChatColor.RED + BukkitLang.get(player, + "inventoryFull")); event.setCancelled(true); return; } diff --git a/core/src/main/resources/strings.yml b/core/src/main/resources/strings.yml index fdfff1d0c..f784c7506 100644 --- a/core/src/main/resources/strings.yml +++ b/core/src/main/resources/strings.yml @@ -790,6 +790,7 @@ noPermission: "You do not have permission to do that." trialMode: "Trial Mode" modeDeny: "You are unable to do that in ." duplicateEditor: "You are already using an editor!" +inventoryFull: "Not enough inventory space." difference: "The difference is %gold%%gray%." notInstalled: "Not installed" confirmDelete: "Are you sure?"