diff --git a/Changelog.txt b/Changelog.txt index 3280370f..739a2798 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -5,7 +5,7 @@ - Implement more API event methods to PrePaymentEvent - Fixed issue when the JobsExpGainEvent called when the income 0. - Fixed issue when used the enchanted books, then can't enchanted properly -- Added argument for signUpdate command +- Added argument for signUpdate command, to update all signs - Removed hack for removing items from inventory when in browse GUI - Fixed issue when the player gliding is not valid in 1.9.1 version - Fixed signs updating @@ -13,3 +13,6 @@ - New placeholder %jobsr_user_job_(jname/number)% to show the player job. - Added option to ignore the boosted items usage in off hand. - Fixed money dupping issue when left clicked to block and earn income +- Fixed 1.11 & 1.12 entities don't work +- Fix bone meals dupping issue when interacted with seeds +- Should fixed issue when the JobsPrePaymentEvent getJob method always returns null diff --git a/src/main/java/com/gamingmesh/jobs/Jobs.java b/src/main/java/com/gamingmesh/jobs/Jobs.java index 004de7f9..57b88bab 100644 --- a/src/main/java/com/gamingmesh/jobs/Jobs.java +++ b/src/main/java/com/gamingmesh/jobs/Jobs.java @@ -1139,7 +1139,7 @@ public class Jobs extends JavaPlugin { Boost boost = getPlayerManager().getFinalBonus(jPlayer, prog.getJob(), ent, victim); - JobsPrePaymentEvent JobsPrePaymentEvent = new JobsPrePaymentEvent(jPlayer.getPlayer(), noneJob, income, + JobsPrePaymentEvent JobsPrePaymentEvent = new JobsPrePaymentEvent(jPlayer.getPlayer(), prog.getJob(), income, pointAmount, block, ent, victim, info); Bukkit.getServer().getPluginManager().callEvent(JobsPrePaymentEvent); // If event is canceled, don't do anything diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/editjobs.java b/src/main/java/com/gamingmesh/jobs/commands/list/editjobs.java index 8f9f5912..1705e432 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/editjobs.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/editjobs.java @@ -95,10 +95,7 @@ public class editjobs implements Cmd { if (!pi.isEntryOk()) continue; - String materialName = one.getName().toLowerCase().replace('_', ' '); - materialName = Character.toUpperCase(materialName.charAt(0)) + materialName.substring(1); - materialName = Jobs.getNameTranslatorManager().Translate(materialName, one); - materialName = org.bukkit.ChatColor.translateAlternateColorCodes('&', materialName); + String materialName = one.getRealisticName(); RawMessage rm = new RawMessage(); rm.add(Jobs.getLanguage().getMessage("command.editjobs.help.list.material", "%materialname%", materialName), one.getName(), "jobs editjobs list " + job.getName() + " " + actionT @@ -494,10 +491,7 @@ public class editjobs implements Cmd { // check entities EntityType entity = EntityType.fromName(myKey.toUpperCase()); if (entity == null) { - try { - entity = EntityType.valueOf(myKey.toUpperCase()); - } catch (IllegalArgumentException e) { - } + entity = EntityType.valueOf(myKey.toUpperCase()); } if (entity != null && entity.isAlive()) { @@ -565,7 +559,8 @@ public class editjobs implements Cmd { } } type = myKey; - } else if (actionT == ActionType.CUSTOMKILL || actionT == ActionType.SHEAR || actionT == ActionType.MMKILL) + } else if (actionT == ActionType.CUSTOMKILL || actionT == ActionType.SHEAR || actionT == ActionType.MMKILL + || actionT == ActionType.COLLECT) type = myKey; else if (actionT == ActionType.EXPLORE) { type = myKey; @@ -580,9 +575,6 @@ public class editjobs implements Cmd { Jobs.getExplore().setPlayerAmount(amount + 1); } else if (actionT == ActionType.CRAFT && myKey.startsWith("!")) type = myKey.substring(1, myKey.length()); - else if (actionT == ActionType.COLLECT) { - type = myKey; - } if (type == null) { player.sendMessage(ChatColor.GOLD + "Job " + job.getName() + " has an invalid " + actionT.getName() + " type property: " + key + "!"); diff --git a/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java b/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java index aa194c49..9ef66f62 100644 --- a/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java @@ -1138,7 +1138,8 @@ public class ConfigManager { continue; } type = enchant == null ? myKey : enchant.toString(); - } else if (actionType == ActionType.CUSTOMKILL || actionType == ActionType.SHEAR || actionType == ActionType.MMKILL) + } else if (actionType == ActionType.CUSTOMKILL || actionType == ActionType.COLLECT || actionType == ActionType.MMKILL + || actionType == ActionType.SHEAR) type = myKey; else if (actionType == ActionType.EXPLORE) { type = myKey; @@ -1153,9 +1154,6 @@ public class ConfigManager { Jobs.getExplore().setPlayerAmount(amount + 1); } else if (actionType == ActionType.CRAFT && myKey.startsWith("!")) type = myKey.substring(1, myKey.length()); - else if (actionType == ActionType.COLLECT) { - type = myKey; - } if (type == null) { Jobs.getPluginLogger().warning("Job " + jobKey + " has an invalid " + actionType.getName() + " type property: " + key + "!"); diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java index 43075a96..663efc42 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java @@ -426,7 +426,7 @@ public class JobsPaymentListener implements Listener { return; if (Version.isCurrentEqualOrLower(Version.v1_12_R1) - && ItemManager.getItem(event.getItemInHand()).isSimilar(ItemManager.getItem(CMIMaterial.BONE_MEAL))) + && ItemManager.getItem(event.getItemInHand()).isSimilar(ItemManager.getItem(CMIMaterial.BONE_MEAL))) return; // check if in creative