diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/ItemManager.java b/src/main/java/com/gamingmesh/jobs/CMILib/ItemManager.java index 14695af4..526466cf 100644 --- a/src/main/java/com/gamingmesh/jobs/CMILib/ItemManager.java +++ b/src/main/java/com/gamingmesh/jobs/CMILib/ItemManager.java @@ -644,7 +644,7 @@ public class ItemManager { BEEF(363, 0, 4803, "Raw Beef", ""), BEETROOT(434, 0, 23305, "Beetroot", ""), BEETROOTS(207, 0, 22075, "Beetroots", "BEETROOT_BLOCK"), - BEETROOT_SEEDS(435, 0, 21282, "Beetroot Seeds", ""), + BEETROOT_SEEDS(435, 0, 21282, "Beetroot Seeds", "SEEDS"), BEETROOT_SOUP(436, 0, 16036, "Beetroot Soup", ""), BIRCH_BOAT(445, 0, 28104, "Birch Boat", "BOAT_BIRCH"), BIRCH_BUTTON(-1, -1, 26934, "Birch Button", ""), @@ -1106,7 +1106,7 @@ public class ItemManager { MAGMA_CUBE_SPAWN_EGG(383, 62, 26638, "Spawn Magma Cube", "Magma Cube Spawn Egg"), MAP(395, 0, 21655, "Empty Map", "EMPTY_MAP"), MELON(103, 0, 25172, "Melon", "Melon_Block"), - MELON_SEEDS(362, 0, 18340, "Melon Seeds", ""), + MELON_SEEDS(362, 0, 18340, "Melon Seeds", "SEEDS"), MELON_SLICE(360, 0, 5347, "Melon Slice", ""), MELON_STEM(105, 0, 8247, "Melon Stem", ""), MILK_BUCKET(335, 0, 9680, "Milk Bucket", ""), @@ -1293,7 +1293,7 @@ public class ItemManager { PUFFERFISH_SPAWN_EGG(-1, -1, 24573, "Pufferfish Spawn Egg", ""), PUMPKIN(86, 0, 19170, "Pumpkin", "PUMPKIN"), PUMPKIN_PIE(400, 0, 28725, "Pumpkin Pie", ""), - PUMPKIN_SEEDS(361, 0, 28985, "Pumpkin Seeds", ""), + PUMPKIN_SEEDS(361, 0, 28985, "Pumpkin Seeds", "SEEDS"), PUMPKIN_STEM(104, 0, 19021, "Pumpkin Stem", ""), PURPLE_BANNER(425, 5, 29027, "Purple Banner", ""), PURPLE_BED(355, 10, 29755, "Purple Bed", "Purple Bed"), diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/browse.java b/src/main/java/com/gamingmesh/jobs/commands/list/browse.java index 3260c8c3..3dbb02c2 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/browse.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/browse.java @@ -83,7 +83,7 @@ public class browse implements Cmd { String hoverMsg = ""; if (!one.getDescription().isEmpty()) - hoverMsg += one.getDescription().replace("/n", ""); + hoverMsg += Jobs.getLanguage().getMessage("command.browse.output.description", "[description]", one.getDescription().replace("/n", "")); if (one.getMaxLevel(sender) > 0) { if (!hoverMsg.isEmpty()) @@ -136,7 +136,7 @@ public class browse implements Cmd { if (!j.getFullDescription().isEmpty()) { for (String one : j.getFullDescription()) { - sender.sendMessage(one); + sender.sendMessage(Jobs.getLanguage().getMessage("command.browse.output.description", "[description]", one)); } } @@ -153,39 +153,28 @@ public class browse implements Cmd { } } else { if (j == null) { - sender.sendMessage(Jobs.getLanguage().getMessage("command.browse.output.newHeader", "[amount]", jobList.size())); + sender.sendMessage(Jobs.getLanguage().getMessage("command.browse.output.console.newHeader", "[amount]", jobList.size(), "\\n", "\n")); for (Job one : jobList) { String msg = ""; if (!one.getDescription().isEmpty()) - msg += one.getDescription().replace("/n", ""); + msg += Jobs.getLanguage().getMessage("command.browse.output.console.description", "[description]", one.getDescription().replace("/n", "")); - if (one.getMaxLevel(sender) > 0) { - if (!msg.isEmpty()) - msg += " \n"; - msg += Jobs.getLanguage().getMessage("command.info.help.newMax", "[max]", one.getMaxLevel(sender)); - } + if (one.getMaxLevel(sender) > 0) + msg += Jobs.getLanguage().getMessage("command.browse.output.console.newMax", "[max]", one.getMaxLevel(sender)); - if (Jobs.getGCManager().ShowTotalWorkers) { - if (!msg.isEmpty()) - msg += " \n"; - msg += Jobs.getLanguage().getMessage("command.browse.output.totalWorkers", "[amount]", one.getTotalPlayers()); - - } + if (Jobs.getGCManager().ShowTotalWorkers) + msg += Jobs.getLanguage().getMessage("command.browse.output.console.totalWorkers", "[amount]", one.getTotalPlayers()); if (Jobs.getGCManager().useDynamicPayment && Jobs.getGCManager().ShowPenaltyBonus) { - if (!msg.isEmpty()) - msg += " \n"; if ((int) (one.getBonus() * 100) < 0) - msg += Jobs.getLanguage().getMessage("command.browse.output.penalty", "[amount]", (int) (one.getBonus() * 100) * -1); + msg += Jobs.getLanguage().getMessage("command.browse.output.console.penalty", "[amount]", (int) (one.getBonus() * 100) * -1); else - msg += Jobs.getLanguage().getMessage("command.browse.output.bonus", "[amount]", (int) (one.getBonus() * 100)); + msg += Jobs.getLanguage().getMessage("command.browse.output.console.bonus", "[amount]", (int) (one.getBonus() * 100)); } - if (!msg.isEmpty()) - msg += " \n"; - msg += Jobs.getLanguage().getMessage("command.browse.output.consoleList", "[jobname]", one.getName()); + msg += Jobs.getLanguage().getMessage("command.browse.output.console.list", "[jobname]", one.getName()); sender.sendMessage(msg); } @@ -208,7 +197,7 @@ public class browse implements Cmd { if (!j.getFullDescription().isEmpty()) { for (String one : j.getFullDescription()) { - sender.sendMessage(one); + sender.sendMessage(Jobs.getLanguage().getMessage("command.browse.output.description", "[description]", one)); } } } diff --git a/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java b/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java index 4abf819f..a64b9edb 100644 --- a/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java @@ -425,21 +425,21 @@ public class ConfigManager { } int maxLevel = jobSection.getInt("max-level", 0); - if (jobSection.isInt("max-level") || maxLevel < 0) - maxLevel = 0; + if (maxLevel < 0) + maxLevel = 0; int vipmaxLevel = jobSection.getInt("vip-max-level", 0); - if (jobSection.isInt("vip-max-level") || vipmaxLevel < 0) - vipmaxLevel = 0; + if (vipmaxLevel < 0) + vipmaxLevel = 0; Integer maxSlots = jobSection.getInt("slots", 0); - if (jobSection.isInt("slots") || maxSlots.intValue() <= 0) - maxSlots = null; + if (maxSlots.intValue() <= 0) + maxSlots = null; Long rejoinCd = jobSection.getLong("rejoinCooldown", 0L); - if (jobSection.isLong("rejoinCooldown") || rejoinCd < 0L) - rejoinCd = 0L; - rejoinCd = rejoinCd * 1000L; + if (rejoinCd < 0L) + rejoinCd = 0L; + rejoinCd = rejoinCd * 1000L; String jobShortName = jobSection.getString("shortname", null); if (jobShortName == null) { diff --git a/src/main/java/com/gamingmesh/jobs/config/LanguageManager.java b/src/main/java/com/gamingmesh/jobs/config/LanguageManager.java index c4ac735f..705bed3b 100644 --- a/src/main/java/com/gamingmesh/jobs/config/LanguageManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/LanguageManager.java @@ -431,8 +431,17 @@ public class LanguageManager { c.get("command.browse.output.bonus", " &2Bonus: &a[amount]%"); c.get("command.browse.output.newHeader", "&2========== [amount] Available Jobs ========="); + c.get("command.browse.output.description", "[description]"); c.get("command.browse.output.list", " &8[place]. &7[jobname]"); - c.get("command.browse.output.consoleList", " &6[jobname]"); + + c.get("command.browse.output.console.newHeader", "&2========== [amount] Available Jobs ========="); + c.get("command.browse.output.console.description", "[description]"); + c.get("command.browse.output.console.totalWorkers", " &7Workers: &e[amount]"); + c.get("command.browse.output.console.penalty", " &4Penalty: &c[amount]%"); + c.get("command.browse.output.console.bonus", " &2Bonus: &a[amount]%"); + c.get("command.browse.output.console.list", " &6[jobname]"); + c.get("command.browse.output.console.newMax", " &eMax level: &f[max]"); + c.get("command.browse.output.click", "&bClick on the job to see more info about it!"); c.get("command.browse.output.detailed", "&bClick to see more detailed list on job actions"); diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java index 777b4647..29acfae7 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java @@ -378,16 +378,15 @@ public class JobsPaymentListener implements Listener { BlockActionInfo bInfo = new BlockActionInfo(block, ActionType.BREAK); // Checks whether or not the plant is ripe if it does not get money at that time - if (block.getType().equals(CMIMaterial.BEETROOT_SEEDS) || block.getType().equals(CMIMaterial.MELON_SEEDS) || - block.getType().equals(CMIMaterial.WHEAT_SEEDS) || block.getType().equals(CMIMaterial.PUMPKIN_SEEDS) || - block.getType().equals(CMIMaterial.CARROT) || block.getType().equals(CMIMaterial.COCOA_BEANS) || - block.getType().equals(CMIMaterial.POTATO) || block.getType().equals(CMIMaterial.NETHER_WART)) { + if (block.getType().equals(CMIMaterial.WHEAT_SEEDS) || block.getType().equals(CMIMaterial.BEETROOT_SEEDS) || + block.getType().equals(CMIMaterial.MELON_SEEDS) || block.getType().equals(CMIMaterial.WHEAT_SEEDS) || + block.getType().equals(CMIMaterial.PUMPKIN_SEEDS) || block.getType().equals(CMIMaterial.CARROT) || + block.getType().equals(CMIMaterial.COCOA_BEANS) || block.getType().equals(CMIMaterial.POTATO) || + block.getType().equals(CMIMaterial.NETHER_WART) || block.getType().equals(CMIMaterial.WHEAT)) { Crops crop = (Crops) block.getState(); - if (crop.getState().equals(CropState.RIPE)) { + if (crop.getState() == CropState.RIPE) { // continue to get money - } else if (crop.getState().equals(CropState.SEEDED) || crop.getState().equals(CropState.MEDIUM) || - crop.getState().equals(CropState.SMALL) || crop.getState().equals(CropState.TALL) || - crop.getState().equals(CropState.VERY_SMALL) || crop.getState().equals(CropState.VERY_TALL)) + } else return; } FastPayment fp = Jobs.FastPayment.get(player.getName()); diff --git a/src/main/resources/locale/messages_hu.yml b/src/main/resources/locale/messages_hu.yml index a3c2740f..53878c76 100644 --- a/src/main/resources/locale/messages_hu.yml +++ b/src/main/resources/locale/messages_hu.yml @@ -364,9 +364,17 @@ command: totalWorkers: ' &7Dolgozók: &e[amount]' penalty: ' &4Büntetés: &c[amount]%' bonus: ' &2Bónusz: &a[amount]%' - newHeader: '&2========== [amount] ELÉRHETŐ MUNKÁK =========' + newHeader: '&2========== [amount] Elérhető munkák =========' + description: '[description]' list: ' &8[place]. &7[jobname]' - consoleList: ' &6[jobname]' + console: + newHeader: '&2========== [amount] Elérhető munkák =========' + description: '[description]' + totalWorkers: ' &7Dolgozók: &e[amount]' + penalty: ' &4Büntetés: &c[amount]%' + bonus: ' &2Bónusz: &a[amount]%' + list: ' &6[jobname]' + newMax: '&eMaximális szint: &f[max]' click: '&bTovábbi információkért kattints a munkára!' detailed: '&bKattints ide a munka részleteinek mutatásához.' jobHeader: '&2========== [jobname] ========='