diff --git a/src/main/java/com/songoda/epicheads/command/CommandManager.java b/src/main/java/com/songoda/epicheads/command/CommandManager.java index b1bb015..92e1d9f 100644 --- a/src/main/java/com/songoda/epicheads/command/CommandManager.java +++ b/src/main/java/com/songoda/epicheads/command/CommandManager.java @@ -83,7 +83,7 @@ public class CommandManager implements CommandExecutor { } return; } - instance.getLocale().newMessage("event.general.nopermission").sendPrefixedMessage(sender); + instance.getLocale().getMessage("event.general.nopermission").sendPrefixedMessage(sender); } public List getCommands() { diff --git a/src/main/java/com/songoda/epicheads/utils/Methods.java b/src/main/java/com/songoda/epicheads/utils/Methods.java index 1252db7..c4a39bb 100644 --- a/src/main/java/com/songoda/epicheads/utils/Methods.java +++ b/src/main/java/com/songoda/epicheads/utils/Methods.java @@ -105,8 +105,9 @@ public class Methods { meta.setDisplayName(formatText(Setting.ITEM_TOKEN_NAME.getString())); List lore = new ArrayList<>(); for (String line : Setting.ITEM_TOKEN_LORE.getStringList()) - lore.add(formatText(line)); - meta.setLore(lore); + if (!line.equals("")) + lore.add(formatText(line)); + if (lore != null) meta.setLore(lore); itemStack.setItemMeta(meta); return itemStack; } diff --git a/src/main/java/com/songoda/epicheads/utils/settings/SettingsManager.java b/src/main/java/com/songoda/epicheads/utils/settings/SettingsManager.java index 3147bce..6837a09 100644 --- a/src/main/java/com/songoda/epicheads/utils/settings/SettingsManager.java +++ b/src/main/java/com/songoda/epicheads/utils/settings/SettingsManager.java @@ -11,6 +11,7 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.inventory.InventoryClickEvent; +import org.bukkit.event.inventory.InventoryType; import org.bukkit.event.player.AsyncPlayerChatEvent; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; @@ -35,6 +36,7 @@ public class SettingsManager implements Listener { @EventHandler public void onInventoryClick(InventoryClickEvent event) { + if (event.getView().getType() != InventoryType.CHEST) return; ItemStack clickedItem = event.getCurrentItem(); if (event.getInventory() != event.getWhoClicked().getOpenInventory().getTopInventory()