diff --git a/pom.xml b/pom.xml index e954e65..4ce5cda 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ lol.hyper toolstats - 1.8.5 + 1.8.6 jar ToolStats diff --git a/src/main/java/lol/hyper/toolstats/events/CraftItem.java b/src/main/java/lol/hyper/toolstats/events/CraftItem.java index 17f05b4..1610c31 100644 --- a/src/main/java/lol/hyper/toolstats/events/CraftItem.java +++ b/src/main/java/lol/hyper/toolstats/events/CraftItem.java @@ -65,7 +65,9 @@ public class CraftItem implements Listener { // if the player shift clicks, send them this warning if (event.isShiftClick()) { Component component = toolStats.configTools.formatLore("shift-click-warning.crafting", null, null); - event.getWhoClicked().sendMessage(component); + if (component != null) { + event.getWhoClicked().sendMessage(component); + } } // test the item before setting it diff --git a/src/main/java/lol/hyper/toolstats/events/VillagerTrade.java b/src/main/java/lol/hyper/toolstats/events/VillagerTrade.java index 4eef005..0488ff5 100644 --- a/src/main/java/lol/hyper/toolstats/events/VillagerTrade.java +++ b/src/main/java/lol/hyper/toolstats/events/VillagerTrade.java @@ -70,7 +70,9 @@ public class VillagerTrade implements Listener { // if the player shift clicks, show the warning if (event.isShiftClick()) { Component component = toolStats.configTools.formatLore("shift-click-warning.trading", null, null); - event.getWhoClicked().sendMessage(component); + if (component != null) { + event.getWhoClicked().sendMessage(component); + } } ItemStack newItem = addLore(item, player); if (newItem != null) { diff --git a/src/main/java/lol/hyper/toolstats/tools/config/ConfigTools.java b/src/main/java/lol/hyper/toolstats/tools/config/ConfigTools.java index d556bc5..e1a1548 100644 --- a/src/main/java/lol/hyper/toolstats/tools/config/ConfigTools.java +++ b/src/main/java/lol/hyper/toolstats/tools/config/ConfigTools.java @@ -100,6 +100,12 @@ public class ConfigTools { public Component formatLore(String configName, String placeHolder, Object value) { String lore = toolStats.config.getString("messages." + configName); if (lore == null) { + toolStats.logger.warning("Unable to find config message for: messages." + configName); + return null; + } + + // if the config message is empty, don't send it + if (lore.isEmpty()) { return null; }