From 32db8ef1eaac29f2fdbd2e66b094ed7d1005b782 Mon Sep 17 00:00:00 2001 From: montlikadani Date: Mon, 22 Oct 2018 19:16:06 +0200 Subject: [PATCH] Fix #267 The potion names & the colors not working correctly. --- .../com/gamingmesh/jobs/config/NameTranslatorManager.java | 2 +- src/main/java/com/gamingmesh/jobs/config/ShopManager.java | 4 ++-- src/main/java/com/gamingmesh/jobs/container/JobItems.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java b/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java index 6f59ac92..ae1bdf53 100644 --- a/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java @@ -214,7 +214,7 @@ public class NameTranslatorManager { String meta = one.split("-")[0]; String MCName = one.split("-")[1]; String Name = ItemFile.getConfig().getString("PotionNamesList." + one); - ListOfColors.add(new NameList(id, meta, Name, MCName)); + ListOfPotionNames.add(new NameList(id, meta, Name, MCName)); } if (ListOfPotionNames.size() > 0) Jobs.consoleMsg("&e[Jobs] Loaded " + ListOfPotionNames.size() + " custom potion names!"); diff --git a/src/main/java/com/gamingmesh/jobs/config/ShopManager.java b/src/main/java/com/gamingmesh/jobs/config/ShopManager.java index 98f083f7..2c43f1dd 100644 --- a/src/main/java/com/gamingmesh/jobs/config/ShopManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/ShopManager.java @@ -116,8 +116,8 @@ public class ShopManager { } if (player.getInventory().firstEmpty() == -1) { - player.sendMessage(Jobs.getLanguage().getMessage("command.shop.info.InvFull")); - return; + player.sendMessage(Jobs.getLanguage().getMessage("command.shop.info.InvFull")); + return; } for (String one : item.getCommands()) { diff --git a/src/main/java/com/gamingmesh/jobs/container/JobItems.java b/src/main/java/com/gamingmesh/jobs/container/JobItems.java index fad5195b..04eb72d1 100644 --- a/src/main/java/com/gamingmesh/jobs/container/JobItems.java +++ b/src/main/java/com/gamingmesh/jobs/container/JobItems.java @@ -69,7 +69,7 @@ public class JobItems { ItemMeta meta = item.getItemMeta(); if (this.name != null) meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', name)); - if (lore != null) { + if (lore != null && !lore.isEmpty()) { List TranslatedLore = new ArrayList<>(); for (String oneLore : lore) { TranslatedLore.add(ChatColor.translateAlternateColorCodes('&', oneLore.replace("[player]", player.getName())));