Inform lack of crafting space, see #2247

This commit is contained in:
PikaMug 2024-07-09 00:42:25 -04:00
parent 9d729dc6ae
commit 10880e8a2e
2 changed files with 6 additions and 0 deletions

View File

@ -12,9 +12,12 @@ package me.pikamug.quests.listeners;
import me.pikamug.quests.BukkitQuestsPlugin; import me.pikamug.quests.BukkitQuestsPlugin;
import me.pikamug.quests.enums.ObjectiveType; import me.pikamug.quests.enums.ObjectiveType;
import me.pikamug.quests.nms.BukkitActionBarProvider;
import me.pikamug.quests.player.Quester; import me.pikamug.quests.player.Quester;
import me.pikamug.quests.quests.Quest; import me.pikamug.quests.quests.Quest;
import me.pikamug.quests.util.BukkitInventoryUtil; import me.pikamug.quests.util.BukkitInventoryUtil;
import me.pikamug.quests.util.BukkitLang;
import org.bukkit.ChatColor;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
@ -66,6 +69,8 @@ public class BukkitItemListener implements Listener {
&& quester.getCurrentStage(quest).containsObjective(type)) { && quester.getCurrentStage(quest).containsObjective(type)) {
if (BukkitInventoryUtil.getEmptySlots(player) if (BukkitInventoryUtil.getEmptySlots(player)
< craftedItem.getAmount() / craftedItem.getMaxStackSize()) { < craftedItem.getAmount() / craftedItem.getMaxStackSize()) {
BukkitActionBarProvider.sendActionBar(player, ChatColor.RED + BukkitLang.get(player,
"inventoryFull"));
event.setCancelled(true); event.setCancelled(true);
return; return;
} }

View File

@ -790,6 +790,7 @@ noPermission: "You do not have permission to do that."
trialMode: "Trial Mode" trialMode: "Trial Mode"
modeDeny: "You are unable to do that in <mode>." modeDeny: "You are unable to do that in <mode>."
duplicateEditor: "You are already using an editor!" duplicateEditor: "You are already using an editor!"
inventoryFull: "Not enough inventory space."
difference: "The difference is %gold%<data>%gray%." difference: "The difference is %gold%<data>%gray%."
notInstalled: "Not installed" notInstalled: "Not installed"
confirmDelete: "Are you sure?" confirmDelete: "Are you sure?"