diff --git a/src/main/java/com/gamingmesh/jobs/Signs/SignUtil.java b/src/main/java/com/gamingmesh/jobs/Signs/SignUtil.java index 7020248d..af589e43 100644 --- a/src/main/java/com/gamingmesh/jobs/Signs/SignUtil.java +++ b/src/main/java/com/gamingmesh/jobs/Signs/SignUtil.java @@ -69,9 +69,6 @@ public class SignUtil { // Signs save file public void saveSigns() { - if (!Jobs.getGCManager().SignsEnabled) - return; - File f = new File(Jobs.getFolder(), "Signs.yml"); YamlConfiguration conf = YamlConfiguration.loadConfiguration(f); diff --git a/src/main/java/com/gamingmesh/jobs/config/LanguageManager.java b/src/main/java/com/gamingmesh/jobs/config/LanguageManager.java index 93eaeacf..93bb4109 100644 --- a/src/main/java/com/gamingmesh/jobs/config/LanguageManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/LanguageManager.java @@ -590,7 +590,7 @@ public class LanguageManager { c.get("command.level.help.info", "Change the player's level in a job."); c.get("command.level.help.args", "[playername] [jobname] set/add/take [amount]"); Jobs.getGCManager().commandArgs.put("level", Arrays.asList("[playername]", "[jobname]", "set%%add%%take")); - c.get("command.exp.error.nojob", "&cThis player must first join a job."); + c.get("command.level.error.nojob", "&cThis player must first join a job."); c.get("command.level.output.target", "&eYour level was changed for %jobname% &eand now you at &6%level%lvl &eand with &6%exp%exp."); c.get("command.demote.help.info", "Demote the player X levels in a job."); diff --git a/src/main/java/com/gamingmesh/jobs/config/ShopManager.java b/src/main/java/com/gamingmesh/jobs/config/ShopManager.java index a9e4778f..e9e43c60 100644 --- a/src/main/java/com/gamingmesh/jobs/config/ShopManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/ShopManager.java @@ -415,7 +415,7 @@ public class ShopManager { String id = null; if (itemSection.isString("Id")) - id = itemSection.getString("Id"); + id = itemSection.getString("Id"); else { Jobs.getPluginLogger().severe("Shop item " + category + " has an invalid GiveItems name property. Skipping!"); continue; diff --git a/src/main/java/com/gamingmesh/jobs/container/JobItems.java b/src/main/java/com/gamingmesh/jobs/container/JobItems.java index c433d8a7..cdcbd313 100644 --- a/src/main/java/com/gamingmesh/jobs/container/JobItems.java +++ b/src/main/java/com/gamingmesh/jobs/container/JobItems.java @@ -37,6 +37,7 @@ public class JobItems { private String node; private String legacyKey = null; private ItemStack item; + private HashMap enchants; private BoostMultiplier boostMultiplier = new BoostMultiplier(); private List jobs = new ArrayList<>(); private int fromLevel = 0; @@ -47,6 +48,7 @@ public class JobItems { try { item = mat.newItemStack(); item.setAmount(amount); + this.enchants = enchants; ItemMeta meta = item.getItemMeta(); if (meta == null) return; @@ -98,6 +100,11 @@ public class JobItems { } meta.setLore(TranslatedLore); } + if (enchants != null) { + for (Entry OneEnchant : enchants.entrySet()) { + meta.addEnchant(OneEnchant.getKey(), OneEnchant.getValue(), true); + } + } item.setItemMeta(meta); return item; } catch (Throwable e) { @@ -125,6 +132,10 @@ public class JobItems { this.jobs = jobs; } + public HashMap getEnchants() { + return enchants; + } + public int getFromLevel() { return fromLevel; } diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java index e65194f4..96deead3 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java @@ -394,12 +394,13 @@ public class JobsListener implements Listener { Sign sign = (Sign) block.getState(); String FirstLine = sign.getLine(0); - if (FirstLine.equalsIgnoreCase(Jobs.getLanguage().getMessage("signs.topline"))) + if (FirstLine.contains(Jobs.getLanguage().getMessage("signs.topline"))) { if (!player.hasPermission("jobs.command.signs")) { event.setCancelled(true); player.sendMessage(Jobs.getLanguage().getMessage("signs.cantdestroy")); return; } + } Location loc = block.getLocation(); @@ -685,10 +686,10 @@ public class JobsListener implements Listener { String meinOk = null; mein: for (JobProgression one : prog) { - for (JobLimitedItems oneItem : one.getJob().getLimitedItems().values()) { - if (one.getLevel() >= oneItem.getLevel()) + for (Entry oneItem : one.getJob().getLimitedItems().entrySet()) { + if (one.getLevel() >= oneItem.getValue().getLevel()) continue; - if (!isThisItem(oneItem, iih.getType().getId(), name, lore, enchants)) + if (!isThisItem(oneItem.getValue(), iih.getType().getId(), name, lore, enchants)) continue; meinOk = one.getJob().getName(); break mein; @@ -739,7 +740,7 @@ public class JobsListener implements Listener { if (event.isCancelled()) return; if (event.getPlayer() == null || !event.getPlayer().isOnline()) - return; + return; //disabling plugin in world if (event.getTo() != null && !Jobs.getGCManager().canPerformActionInWorld(event.getTo().getWorld()))