From 0b4e2b48c92dcbc7449f35dccd67ba3bf84d5377 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Fri, 21 Jun 2019 12:45:31 -0700 Subject: [PATCH 01/26] Dev mode --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index db5e395a6..679c6e303 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.86 + 2.1.87-SNAPSHOT mcMMO https://github.com/mcMMO-Dev/mcMMO From 1984131874460d970ba78d4a13798f7af27da213 Mon Sep 17 00:00:00 2001 From: Werner Date: Sat, 22 Jun 2019 13:33:03 +0200 Subject: [PATCH 02/26] Update locale_de.properties --- src/main/resources/locale/locale_de.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/locale/locale_de.properties b/src/main/resources/locale/locale_de.properties index d8504e6e2..38f963661 100644 --- a/src/main/resources/locale/locale_de.properties +++ b/src/main/resources/locale/locale_de.properties @@ -357,7 +357,7 @@ Fishing.Ability.TH.Boom = &c&lDeine Angelschnur hat sich in Fishing.Ability.TH.MagicFound = &bDu f\u00FChlst etwas magisches in diesem Fang... Fishing.Ability.TH.Poison = &7Irgendentwas stinkt hier... Fishing.Chance.Raining = &9 Regen Bonus -Fishing.Exhausting = &c&oUnsachgem\u00E4\u00DFe Benutzung der Angelrute f\u00FChrt zu erm\u00FCdung und abnutzen der Rute. +Fishing.Exhausting = &c&oUnsachgem\u00E4\u00DFe Nutzung der Angelrute f\u00FChrt zu Erm\u00FCdung und abnutzen der Rute. Fishing.Listener = Angeln: Fishing.LowResources = &7Du sp\u00FCrst, dass hier wahrscheinlich nicht viele Fische \u00FCbrig sind... Fishing.Scarcity = &e&oAn diesem Ort wurde bereits sehr oft geangelt, versuche es woanders. From b479d45f14ae55d000d8f07f509c57e4d15cdff6 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sat, 22 Jun 2019 14:48:16 -0700 Subject: [PATCH 03/26] Level Cap bugfixes and tweaks --- Changelog.txt | 9 ++++ .../commands/experience/AddlevelsCommand.java | 2 +- .../commands/experience/MmoeditCommand.java | 2 +- .../experience/SkillresetCommand.java | 2 +- .../nossr50/datatypes/player/McMMOPlayer.java | 49 +++++++++++++++---- .../com/gmail/nossr50/util/EventUtils.java | 8 +-- .../resources/locale/locale_en_US.properties | 5 +- 7 files changed, 60 insertions(+), 17 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index c01108232..b751999c4 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,3 +1,12 @@ +Version 2.1.87 + (Level caps are not on by default in mcMMO, this is something you can turn on) + + Players who reach either the power level cap or skill level cap will now be informed that they have done so + XP Bars will no longer be sent to players who have reached the power level or skill level cap respectively + Level up messages will no longer be sent to players who have reached the power level or skill level cap respectively + Fixed a bug where mcMMO would send level up notifications to a player if the custom level up event from mcMMO was cancelled + New locale strings 'LevelCap.PowerLevel' & 'LevelCap.Skill' + Version 2.1.86 Players will no longer be told they got a perfect result when salvaging if they are below max skill level Salvage results will now travel towards the player instead of moving in a random direction diff --git a/src/main/java/com/gmail/nossr50/commands/experience/AddlevelsCommand.java b/src/main/java/com/gmail/nossr50/commands/experience/AddlevelsCommand.java index 22cc3e6f3..e4edefd74 100644 --- a/src/main/java/com/gmail/nossr50/commands/experience/AddlevelsCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/experience/AddlevelsCommand.java @@ -30,7 +30,7 @@ public class AddlevelsCommand extends ExperienceCommand { return; } - EventUtils.handleLevelChangeEvent(player, skill, value, xpRemoved, true, XPGainReason.COMMAND); + EventUtils.tryLevelChangeEvent(player, skill, value, xpRemoved, true, XPGainReason.COMMAND); } @Override diff --git a/src/main/java/com/gmail/nossr50/commands/experience/MmoeditCommand.java b/src/main/java/com/gmail/nossr50/commands/experience/MmoeditCommand.java index ded4aaa18..4e483dc6a 100644 --- a/src/main/java/com/gmail/nossr50/commands/experience/MmoeditCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/experience/MmoeditCommand.java @@ -36,7 +36,7 @@ public class MmoeditCommand extends ExperienceCommand { return; } - EventUtils.handleLevelChangeEventEdit(player, skill, value, xpRemoved, value > skillLevel, XPGainReason.COMMAND, skillLevel); + EventUtils.tryLevelEditEvent(player, skill, value, xpRemoved, value > skillLevel, XPGainReason.COMMAND, skillLevel); } @Override diff --git a/src/main/java/com/gmail/nossr50/commands/experience/SkillresetCommand.java b/src/main/java/com/gmail/nossr50/commands/experience/SkillresetCommand.java index 16a28d720..553ecee49 100644 --- a/src/main/java/com/gmail/nossr50/commands/experience/SkillresetCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/experience/SkillresetCommand.java @@ -126,7 +126,7 @@ public class SkillresetCommand implements TabExecutor { return; } - EventUtils.handleLevelChangeEvent(player, skill, levelsRemoved, xpRemoved, false, XPGainReason.COMMAND); + EventUtils.tryLevelChangeEvent(player, skill, levelsRemoved, xpRemoved, false, XPGainReason.COMMAND); } protected boolean permissionsCheckSelf(CommandSender sender) { diff --git a/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java b/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java index 6b1a9bc2f..53c93781a 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java +++ b/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java @@ -41,6 +41,7 @@ import com.gmail.nossr50.skills.woodcutting.WoodcuttingManager; import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; +import com.gmail.nossr50.util.StringUtils; import com.gmail.nossr50.util.experience.ExperienceBarManager; import com.gmail.nossr50.util.player.NotificationManager; import com.gmail.nossr50.util.player.UserManager; @@ -150,8 +151,15 @@ public class McMMOPlayer { experienceBarManager.hideExperienceBar(primarySkillType); }*/ - public void processPostXpEvent(XPGainReason xpGainReason, PrimarySkillType primarySkillType, Plugin plugin, XPGainSource xpGainSource) + public void processPostXpEvent(PrimarySkillType primarySkillType, Plugin plugin, XPGainSource xpGainSource) { + //Check if they've reached the power level cap just now + if(hasReachedPowerLevelCap()) { + NotificationManager.sendPlayerInformationChatOnly(player, "LevelCap.PowerLevel", String.valueOf(Config.getInstance().getPowerLevelCap())); + } else if(hasReachedLevelCap(primarySkillType)) { + NotificationManager.sendPlayerInformationChatOnly(player, "LevelCap.Skill", String.valueOf(Config.getInstance().getPowerLevelCap()), primarySkillType.getName()); + } + //Updates from Party sources if(xpGainSource == XPGainSource.PARTY_MEMBERS && !ExperienceConfig.getInstance().isPartyExperienceBarsEnabled()) return; @@ -459,6 +467,31 @@ public class McMMOPlayer { return powerLevel; } + /** + * Whether or not a player is level capped + * If they are at the power level cap, this will return true, otherwise it checks their skill level + * @param primarySkillType + * @return + */ + public boolean hasReachedLevelCap(PrimarySkillType primarySkillType) { + if(hasReachedPowerLevelCap()) + return true; + + if(getSkillLevel(primarySkillType) >= Config.getInstance().getLevelCap(primarySkillType)) + return true; + + return false; + } + + /** + * Whether or not a player is power level capped + * Compares their power level total to the current set limit + * @return true if they have reached the power level cap + */ + public boolean hasReachedPowerLevelCap() { + return this.getPowerLevel() >= Config.getInstance().getPowerLevelCap(); + } + /** * Begins an experience gain. The amount will be affected by skill modifiers, global rate, perks, and may be shared with the party * @@ -549,8 +582,11 @@ public class McMMOPlayer { * @param primarySkillType The skill to check */ private void checkXp(PrimarySkillType primarySkillType, XPGainReason xpGainReason, XPGainSource xpGainSource) { + if(hasReachedLevelCap(primarySkillType)) + return; + if (getSkillXpLevelRaw(primarySkillType) < getXpToLevel(primarySkillType)) { - processPostXpEvent(xpGainReason, primarySkillType, mcMMO.p, xpGainSource); + processPostXpEvent(primarySkillType, mcMMO.p, xpGainSource); return; } @@ -567,8 +603,7 @@ public class McMMOPlayer { levelsGained++; } - if (!EventUtils.handleLevelChangeEvent(player, primarySkillType, levelsGained, xpRemoved, true, xpGainReason)) { - processPostXpEvent(xpGainReason, primarySkillType, mcMMO.p, xpGainSource); + if (EventUtils.tryLevelChangeEvent(player, primarySkillType, levelsGained, xpRemoved, true, xpGainReason)) { return; } @@ -583,7 +618,7 @@ public class McMMOPlayer { NotificationManager.sendPlayerLevelUpNotification(this, primarySkillType, levelsGained, profile.getSkillLevel(primarySkillType)); //UPDATE XP BARS - processPostXpEvent(xpGainReason, primarySkillType, mcMMO.p, xpGainSource); + processPostXpEvent(primarySkillType, mcMMO.p, xpGainSource); } /* @@ -934,10 +969,6 @@ public class McMMOPlayer { return (int) (((deactivatedTimestamp + (PerksUtils.handleCooldownPerks(player, ability.getCooldown()) * Misc.TIME_CONVERSION_FACTOR)) - System.currentTimeMillis()) / Misc.TIME_CONVERSION_FACTOR); } - private boolean hasReachedLevelCap(PrimarySkillType skill) { - return (skill.getMaxLevel() < getSkillLevel(skill) + 1) || (Config.getInstance().getPowerLevelCap() < getPowerLevel() + 1); - } - /* * These functions are wrapped from PlayerProfile so that we don't always have to store it alongside the McMMOPlayer object. */ diff --git a/src/main/java/com/gmail/nossr50/util/EventUtils.java b/src/main/java/com/gmail/nossr50/util/EventUtils.java index b88958206..026dabd60 100644 --- a/src/main/java/com/gmail/nossr50/util/EventUtils.java +++ b/src/main/java/com/gmail/nossr50/util/EventUtils.java @@ -187,7 +187,7 @@ public class EventUtils { return event; } - public static boolean handleLevelChangeEvent(Player player, PrimarySkillType skill, int levelsChanged, float xpRemoved, boolean isLevelUp, XPGainReason xpGainReason) { + public static boolean tryLevelChangeEvent(Player player, PrimarySkillType skill, int levelsChanged, float xpRemoved, boolean isLevelUp, XPGainReason xpGainReason) { McMMOPlayerLevelChangeEvent event = isLevelUp ? new McMMOPlayerLevelUpEvent(player, skill, levelsChanged, xpGainReason) : new McMMOPlayerLevelDownEvent(player, skill, levelsChanged, xpGainReason); mcMMO.p.getServer().getPluginManager().callEvent(event); @@ -200,10 +200,10 @@ public class EventUtils { profile.addXp(skill, xpRemoved); } - return !isCancelled; + return isCancelled; } - public static boolean handleLevelChangeEventEdit(Player player, PrimarySkillType skill, int levelsChanged, float xpRemoved, boolean isLevelUp, XPGainReason xpGainReason, int oldLevel) { + public static boolean tryLevelEditEvent(Player player, PrimarySkillType skill, int levelsChanged, float xpRemoved, boolean isLevelUp, XPGainReason xpGainReason, int oldLevel) { McMMOPlayerLevelChangeEvent event = isLevelUp ? new McMMOPlayerLevelUpEvent(player, skill, levelsChanged - oldLevel, xpGainReason) : new McMMOPlayerLevelDownEvent(player, skill, levelsChanged, xpGainReason); mcMMO.p.getServer().getPluginManager().callEvent(event); @@ -216,7 +216,7 @@ public class EventUtils { profile.addXp(skill, xpRemoved); } - return !isCancelled; + return isCancelled; } /** diff --git a/src/main/resources/locale/locale_en_US.properties b/src/main/resources/locale/locale_en_US.properties index 74cc5cce9..e502a310d 100644 --- a/src/main/resources/locale/locale_en_US.properties +++ b/src/main/resources/locale/locale_en_US.properties @@ -1095,4 +1095,7 @@ Holiday.Anniversary=[[BLUE]]Happy {0} Year Anniversary!\n[[BLUE]]In honor of all #Reminder Messages Reminder.Squelched=[[GRAY]]Reminder: You are currently not receiving notifications from mcMMO, to enable notifications please run the /mcnotify command again. This is an automated hourly reminder. #Locale -Locale.Reloaded=[[GREEN]]Locale reloaded! \ No newline at end of file +Locale.Reloaded=[[GREEN]]Locale reloaded! +#Player Leveling Stuff +LevelCap.PowerLevel=[[GOLD]]([[GREEN]]mcMMO[[GOLD]]) [[YELLOW]]You have reached the power level cap of [[RED]]{0}[[YELLOW]]. You will cease to level in skills from this point on. +LevelCap.Skill=[[GOLD]]([[GREEN]]mcMMO[[GOLD]]) [[YELLOW]]You have reached the level cap of [[RED]]{0}[[YELLOW]] for [[GOLD]]{1}[[YELLOW]]. You will cease to level in this skill from this point on. \ No newline at end of file From ae6d377abb6585ebf25429e22fc4545f5a9bef18 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sat, 22 Jun 2019 15:03:51 -0700 Subject: [PATCH 04/26] Fixing a mistake when grabbing level cap --- .../java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java b/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java index 53c93781a..8131772f2 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java +++ b/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java @@ -157,7 +157,7 @@ public class McMMOPlayer { if(hasReachedPowerLevelCap()) { NotificationManager.sendPlayerInformationChatOnly(player, "LevelCap.PowerLevel", String.valueOf(Config.getInstance().getPowerLevelCap())); } else if(hasReachedLevelCap(primarySkillType)) { - NotificationManager.sendPlayerInformationChatOnly(player, "LevelCap.Skill", String.valueOf(Config.getInstance().getPowerLevelCap()), primarySkillType.getName()); + NotificationManager.sendPlayerInformationChatOnly(player, "LevelCap.Skill", String.valueOf(Config.getInstance().getLevelCap(primarySkillType)), primarySkillType.getName()); } //Updates from Party sources From 68864dae2d013a9792b65fd896701e20cdb4e783 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sat, 22 Jun 2019 15:06:24 -0700 Subject: [PATCH 05/26] 2.1.87 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 679c6e303..2ee48ab08 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.87-SNAPSHOT + 2.1.87 mcMMO https://github.com/mcMMO-Dev/mcMMO From 9ab4d59cca3407c0758f82372b2aa902c4cfc22b Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sat, 22 Jun 2019 22:35:25 -0700 Subject: [PATCH 06/26] mcMMO will ignore damage triggers for events with a value of zero --- Changelog.txt | 4 ++++ pom.xml | 2 +- .../com/gmail/nossr50/listeners/EntityListener.java | 13 +++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Changelog.txt b/Changelog.txt index b751999c4..509656459 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,3 +1,7 @@ +Version 2.1.88 + mcMMO is now more compatible with a plugin named Project Korra + mcMMO will no longer process combat triggers for damage at or below 0 + Version 2.1.87 (Level caps are not on by default in mcMMO, this is something you can turn on) diff --git a/pom.xml b/pom.xml index 2ee48ab08..5725ee2c9 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.87 + 2.1.88 mcMMO https://github.com/mcMMO-Dev/mcMMO diff --git a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java index c16356e70..276dcd7d8 100644 --- a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java @@ -416,6 +416,19 @@ public class EntityListener implements Listener { } } + /* + * This was put here to solve a plugin conflict with a mod called Project Korra + * Project Korra sends out a damage event with exactly 0 damage + * mcMMO does some calculations for the damage in an event and it ends up dividing by zero, + * as a result of the modifiers for the event being 0 and the damage set for this event being 0. + * + * Surprising this kind of thing + * + */ + if(damage <= 0) { + return; + } + CombatUtils.processCombatAttack(event, attacker, target); CombatUtils.handleHealthbars(attacker, target, event.getFinalDamage(), plugin); From 4fafb5731e3079af5bda05f0cabf0402064727d7 Mon Sep 17 00:00:00 2001 From: Werner Date: Sun, 23 Jun 2019 10:00:07 +0200 Subject: [PATCH 07/26] Update locale_de.properties --- src/main/resources/locale/locale_de.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/locale/locale_de.properties b/src/main/resources/locale/locale_de.properties index 38f963661..5c63a73e3 100644 --- a/src/main/resources/locale/locale_de.properties +++ b/src/main/resources/locale/locale_de.properties @@ -359,8 +359,8 @@ Fishing.Ability.TH.Poison = &7Irgendentwas stinkt hier... Fishing.Chance.Raining = &9 Regen Bonus Fishing.Exhausting = &c&oUnsachgem\u00E4\u00DFe Nutzung der Angelrute f\u00FChrt zu Erm\u00FCdung und abnutzen der Rute. Fishing.Listener = Angeln: -Fishing.LowResources = &7Du sp\u00FCrst, dass hier wahrscheinlich nicht viele Fische \u00FCbrig sind... -Fishing.Scarcity = &e&oAn diesem Ort wurde bereits sehr oft geangelt, versuche es woanders. +Fishing.LowResourcesTip = &7Dein Gesp\u00FChr sagt dir, dass es hier kaum noch Fische gibt. Versuche es mindestens {0} Bl\u00F6cke entfernt. +Fishing.ScarcityTip = &e&oDas Gebiet ist \u00FCberfischt. Versuche es woanders, mindestens {0} Bl\u00F6cke entfernt. Fishing.Scared = &7&oHektische Bewegungen ver\u00E4ngstigen Fische! Fishing.SkillName = Angeln Fishing.SubSkill.FishermansDiet.Description = Verbessert den N\u00E4hrwert von geangelter Nahrung From 046daa43fa693e3a9b1106542d7b01834878846d Mon Sep 17 00:00:00 2001 From: SNAKE0053 <6961187+snake0053@users.noreply.github.com> Date: Mon, 24 Jun 2019 00:11:24 +0900 Subject: [PATCH 08/26] Update locale_ja_JP.properties --- .../resources/locale/locale_ja_JP.properties | 102 +++++++++++++++--- 1 file changed, 88 insertions(+), 14 deletions(-) diff --git a/src/main/resources/locale/locale_ja_JP.properties b/src/main/resources/locale/locale_ja_JP.properties index e66415ef1..a36c97d4e 100644 --- a/src/main/resources/locale/locale_ja_JP.properties +++ b/src/main/resources/locale/locale_ja_JP.properties @@ -364,8 +364,6 @@ Repair.Arcane.Perfect=[[GREEN]]\u3042\u306a\u305f\u306f\u3053\u306e\u30a2\u30a4\ Salvage.Pretty.Name=\u30b5\u30eb\u30d9\u30fc\u30b8 Salvage.SubSkill.UnderstandingTheArt.Name=\u82b8\u8853\u3092\u7406\u89e3\u3059\u308b\u3002 Salvage.SubSkill.UnderstandingTheArt.Description=\u3042\u306a\u305f\u306f\u305f\u3060\u3042\u306a\u305f\u306e\u96a3\u4eba\u306e\u30b4\u30df\u3092\u6398\u308a\u4e0b\u3052\u308b\u306e\u3067\u306f\u306a\u304f\u3001\u3042\u306a\u305f\u306f\u74b0\u5883\u306e\u4e16\u8a71\u3092\u3057\u3066\u3044\u307e\u3059\u3002\n\u30b5\u30eb\u30d9\u30fc\u30b8\u306e\u69d8\u3005\u306a\u7279\u6027\u3092\u5f15\u304d\u51fa\u3059\u3002 -Salvage.SubSkill.AdvancedSalvage.Name=\u9ad8\u5ea6\u306a\u30b5\u30eb\u30d9\u30fc\u30b8 -Salvage.SubSkill.AdvancedSalvage.Description=\u8010\u4e45\u5024\u306e\u6e1b\u3063\u305f\u30a2\u30a4\u30c6\u30e0\u3092\u30b5\u30eb\u30d9\u30fc\u30b8\u3059\u308b\u3002 Salvage.SubSkill.ScrapCollector.Name=\u30b9\u30af\u30e9\u30c3\u30d7\u30b3\u30ec\u30af\u30bf\u30fc Salvage.SubSkill.ScrapCollector.Description=\u30b5\u30eb\u30d9\u30fc\u30b8\u306b\u3088\u308b\u30a2\u30a4\u30c6\u30e0\u304b\u3089\u306e\u7d20\u6750\u56de\u53ce\u3001\u5b8c\u74a7\u306a\u30b5\u30eb\u30d9\u30fc\u30b8\u306f\u30b9\u30ad\u30eb\u3068\u904b\u306b\u4f9d\u5b58\u3057\u307e\u3059\u3002 Salvage.SubSkill.ScrapCollector.Stat=\u30b9\u30af\u30e9\u30c3\u30d7\u30b3\u30ec\u30af\u30bf\u30fc: [[GREEN]]\u6700\u5927[[YELLOW]]{0}\u500b[[GREEN]]\u306e\u30a2\u30a4\u30c6\u30e0\u3092\u30b5\u30eb\u30d9\u30fc\u30b8\u3002\u904b\u304c\u95a2\u4fc2\u3057\u3066\u3044\u307e\u3059\u3002 @@ -386,6 +384,10 @@ Salvage.Skills.ArcaneSuccess=[[GREEN]]\u3053\u306e\u30a2\u30a4\u30c6\u30e0\u306b Salvage.Listener.Anvil=[[DARK_RED]]\u3042\u306a\u305f\u306f\u30b5\u30eb\u30d9\u30fc\u30b8\u30a2\u30f3\u30d3\u30eb\u3092\u8a2d\u7f6e\u3057\u307e\u3057\u305f\u3002\u3053\u308c\u3092\u30c4\u30fc\u30eb\u3068\u9632\u5177\u306e\u30b5\u30eb\u30d9\u30fc\u30b8\u306b\u4f7f\u3063\u3066\u304f\u3060\u3055\u3044\u3002 Salvage.Listener=\u30b5\u30eb\u30d9\u30fc\u30b8: Salvage.SkillName=\u30b5\u30eb\u30d9\u30fc\u30b8 +Salvage.Skills.Lottery.Normal=[[YELLOW]]{1}[[GOLD]]\u304b\u3089[[DARK_AQUA]]{0}[[GOLD]]\u306e\u7d20\u6750\u3092\u56de\u53ce\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002 +Salvage.Skills.Lottery.Perfect=[[GREEN]][[BOLD]]\u30d1\u30fc\u30d5\u30a7\u30af\u30c8\uff01[[RESET]][[GOLD]] \u3042\u306a\u305f\u306f [[DARK_AQUA]]{1}[[GOLD]]\u3092\u30b5\u30eb\u30d9\u30fc\u30b8\u3057\u3001[[DARK_AQUA]]{0}[[GOLD]]\u500b\u306e\u7d20\u6750\u3092\u56de\u53ce\u3057\u307e\u3057\u305f\u3002 +Salvage.Skills.Lottery.Untrained=[[GRAY]]\u3042\u306a\u305f\u306f\u30b5\u30eb\u30d9\u30fc\u30b8\u3092\u6b63\u3057\u304f\u8a13\u7df4\u3067\u304d\u3066\u3044\u307e\u305b\u3093\u3002 [[GREEN]]{1}[[GRAY]]\u304b\u3089[[RED]]{0}[[GRAY]]\u500b\u306e\u7d20\u6750\u3057\u304b\u56de\u53ce\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f + #Anvil (Shared between SALVAGE and REPAIR) Anvil.Unbreakable=\u3053\u306e\u30a2\u30a4\u30c6\u30e0\u306f\u58ca\u308c\u307e\u305b\u3093\uff01 @@ -659,6 +661,18 @@ Commands.Event.XP=[[DARK_AQUA]]XP\u30ec\u30fc\u30c8\u306f\u73fe\u5728[[GOLD]]{0} Commands.xprate.started.0=[[GOLD]]mcMMO\u306eXP\u30a4\u30d9\u30f3\u30c8\u304c\u958b\u59cb\u3055\u308c\u307e\u3057\u305f\uff01 Commands.xprate.started.1=[[GOLD]]mcMMO\u306eXP\u30ec\u30fc\u30c8\u306f3\u500d\u306b\u306a\u308a\u307e\u3057\u305f\uff01 +# Admin Notifications +Server.ConsoleName=[[YELLOW]][Server] +Notifications.Admin.XPRate.Start.Self=[[GRAY]]\u3042\u306a\u305f\u306f[[GOLD]]{0}x[[GRAY]]\u306b\u30b0\u30ed\u30fc\u30d0\u30ebXP\u30ec\u30fc\u30c8\u3092\u8a2d\u5b9a\u3057\u307e\u3057\u305f\u3002 +Notifications.Admin.XPRate.End.Self=[[GRAY]]XP\u30ec\u30fc\u30c8\u30a4\u30d9\u30f3\u30c8\u3092\u7d42\u4e86\u3057\u307e\u3057\u305f\u3002 +Notifications.Admin.XPRate.End.Others={0}[[GRAY]]\u306fXP\u30ec\u30fc\u30c8\u30a4\u30d9\u30f3\u30c8\u3092\u7d42\u4e86\u3057\u307e\u3057\u305f +Notifications.Admin.XPRate.Start.Others={0}[[GRAY]]\u304c{1}x\u3067\u30b0\u30ed\u30fc\u30d0\u30ebXP\u30ec\u30fc\u30c8\u30a4\u30d9\u30f3\u30c8\u3092\u958b\u59cb\u307e\u305f\u306f\u5909\u66f4\u3057\u307e\u3057\u305f +Notifications.Admin.Format.Others=[[GOLD]]([[GREEN]]mcMMO [[DARK_AQUA]]\u7ba1\u7406\u8005[[GOLD]]) [[GRAY]]{0} +Notifications.Admin.Format.Self=[[GOLD]]([[GREEN]]mcMMO[[GOLD]]) [[GRAY]]{0} + +# Event +XPRate.Event=[[GOLD]]mcMMO\u306f\u73fe\u5728XP\u30ec\u30fc\u30c8\u30a4\u30d9\u30f3\u30c8\u4e2d\u3067\u3059\uff01XP\u30ec\u30fc\u30c8\u306f{0}x\u3067\u3059\uff01 + #GUIDES Guides.Available=[[GRAY]]\u5229\u7528\u53ef\u80fd\u306a{0}\u306e\u30ac\u30a4\u30c9 - \/{1} ? [\u30da\u30fc\u30b8] Guides.Header=[[GOLD]]-=[[GREEN]]{0} \u30ac\u30a4\u30c9[[GOLD]]=- @@ -762,20 +776,42 @@ Guides.Woodcutting.Section.1=[[DARK_AQUA]]How does Tree Feller work?\n[[YELLOW]] Guides.Woodcutting.Section.2=[[DARK_AQUA]]How does Leaf Blower work?\n[[YELLOW]]Leaf Blower is a passive ability that will cause leaf\n[[YELLOW]]blocks to break instantly when hit with an axe. By default,\n[[YELLOW]]this ability unlocks at level 100. Guides.Woodcutting.Section.3=[[DARK_AQUA]]How do Double Drops work?\n[[YELLOW]]This passive ability gives you a chance to obtain an extra\n[[YELLOW]]block for every log you chop. +#INSPECT +Inspect.Offline= [[RED]]\u3042\u306a\u305f\u306f\u30aa\u30d5\u30e9\u30a4\u30f3\u30d7\u30ec\u30a4\u30e4\u30fc\u3092\u8abf\u3079\u308b\u6a29\u9650\u3092\u6301\u3063\u3066\u3044\u307e\u305b\u3093\uff01 +Inspect.OfflineStats=\u30aa\u30d5\u30e9\u30a4\u30f3\u30d7\u30ec\u30fc\u30e4\u30fc\u306emcMMO\u7d71\u8a08[[YELLOW]]{0} +Inspect.Stats=[[YELLOW]]{0}[[GREEN]]\u306emcMMO\u7d71\u8a08 +Inspect.TooFar=\u305d\u306e\u30d7\u30ec\u30a4\u30e4\u30fc\u3092\u8abf\u3079\u308b\u306b\u306f\u9060\u3059\u304e\u307e\u3059\uff01 + +#ITEMS +Item.ChimaeraWing.Fail=[[RED]]**\u30ad\u30e1\u30e9\u306e\u7ffc \u5931\u6557\uff01** +Item.ChimaeraWing.Pass=**\u30ad\u30e1\u30e9\u306e\u7ffc** +Item.ChimaeraWing.Name=\u30ad\u30e1\u30e9\u306e\u7ffc +Item.ChimaeraWing.Lore=[[GRAY]]\u3042\u306a\u305f\u3092\u30d9\u30c3\u30c9\u306b\u30c6\u30ec\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002 #TELEPORTATION Teleport.Commencing=[[GOLD]]({0})[[GREY]]\u79d2\u3067\u30c6\u30ec\u30dd\u30fc\u30c8\u3092\u958b\u59cb\u3057\u3066\u307e\u3059\u3002\u3057\u3070\u3089\u304f\u304a\u5f85\u3061\u304f\u3060\u3055\u3044... Teleport.Cancelled=[[DARK_RED]]\u30c6\u30ec\u30dd\u30fc\u30c8\u306f\u30ad\u30e3\u30f3\u30bb\u30eb\u3055\u308c\u307e\u3057\u305f\u3002 + #SKILLS Skills.Child=[[GOLD]](\u5b50\u30b9\u30ad\u30eb) Skills.Disarmed=[[DARK_RED]]\u3042\u306a\u305f\u306f\u6b66\u88c5\u89e3\u9664\u3055\u308c\u307e\u3057\u305f\uff01 Skills.Header=-----[] [[GREEN]]{0}[[RED]] []----- +Skills.NeedMore=[[DARK_RED]]\u3082\u3063\u3068[[GRAY]]{0}[[DARK_RED]]\u304c\u5fc5\u8981\u3067\u3059 +Skills.NeedMore.Extra=[[DARK_RED]]\u3082\u3063\u3068[[GRAY]]{0}{1}[[DARK_RED]]\u304c\u5fc5\u8981\u3067\u3059 +Skills.Parents= PARENTS +Skills.Stats={0}[[GREEN]]{1}[[DARK_AQUA]] XP([[GRAY]]{2}[[DARK_AQUA]]/[[GRAY]]{3}[[DARK_AQUA]]) +Skills.ChildStats={0}[[GREEN]]{1} +Skills.TooTired=\u305d\u306e\u30a2\u30d3\u30ea\u30c6\u30a3\u3092\u518d\u3073\u4f7f\u3046\u306e\u306b\u306f\u98fd\u304d\u904e\u304e\u3066\u3044\u307e\u3059\u3002 [[YELLOW]]({0}\u79d2) +Skills.Cancelled=[[GOLD]]{0} [[RED]]\u30ad\u30e3\u30f3\u30bb\u30eb\uff01 +Skills.ConfirmOrCancel=[[GREEN]]\u3082\u3046\u4e00\u5ea6\u53f3\u30af\u30ea\u30c3\u30af\u3057\u3066[[GOLD]]{0}[[GREEN]]\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u30ad\u30e3\u30f3\u30bb\u30eb\u3059\u308b\u306b\u306f\u5de6\u30af\u30ea\u30c3\u30af\u3057\u3066\u304f\u3060\u3055\u3044\u3002 +Skills.AbilityGateRequirementFail=[[GRAY]]\u3053\u306e\u30a2\u30d3\u30ea\u30c6\u30a3\u3092\u4f7f\u3046\u305f\u3081\u306b\u306f[[YELLOW]]{0}[[GRAY]]\u30ec\u30d9\u30eb\u306e[[DARK_AQUA]]{1}[[GRAY]]\u304c\u5fc5\u8981\u3067\u3059\u3002 #STATISTICS Stats.Header.Combat=[[GOLD]]-=\u30b3\u30f3\u30d0\u30c3\u30c8\u30b9\u30ad\u30eb=- Stats.Header.Gathering=[[GOLD]]-=\u53ce\u96c6\u30b9\u30ad\u30eb=- Stats.Header.Misc=[[GOLD]]-=\u305d\u306e\u4ed6\u306e\u30b9\u30ad\u30eb=- Stats.Own.Stats=[[GREEN]][mcMMO] \u7d71\u8a08 + #PERKS Perks.XP.Name=\u7d4c\u9a13 Perks.XP.Desc=\u7279\u5b9a\u306e\u30b9\u30ad\u30eb\u306e\u30d6\u30fc\u30b9\u30c8XP\u3092\u53d7\u3051\u53d6\u308b\u3002 @@ -783,6 +819,15 @@ Perks.Lucky.Name=\u30e9\u30c3\u30af Perks.Lucky.Desc={0}\u306e\u30b9\u30ad\u30eb\u3068\u80fd\u529b\u306b\u300133.3\uff05\u306e\u30a2\u30af\u30c6\u30a3\u30d9\u30fc\u30c8\u306e\u78ba\u7387\u3092\u4e0e\u3048\u307e\u3059\u3002 Perks.Lucky.Desc.Login=\u7279\u5b9a\u306e\u30b9\u30ad\u30eb\u3084\u80fd\u529b\u306b33.3\uff05\u306e\u30a2\u30af\u30c6\u30a3\u30d9\u30fc\u30c8\u306e\u78ba\u7387\u3092\u4e0e\u3048\u308b\u3002 +#MOTD +MOTD.Donate=[[DARK_AQUA]]\u5bc4\u4ed8\u60c5\u5831: +MOTD.Hardcore.Enabled=[[GOLD]][mcMMO] [[DARK_AQUA]]\u30cf\u30fc\u30c9\u30b3\u30a2\u30e2\u30fc\u30c9\u6709\u52b9: [[DARK_RED]]{0} +MOTD.Hardcore.DeathStatLoss.Stats=[[GOLD]][mcMMO] [[DARK_AQUA]]\u30b9\u30ad\u30eb\u30c7\u30b9\u30da\u30ca\u30eb\u30c6\u30a3: [[DARK_RED]]{0}% +MOTD.Hardcore.Vampirism.Stats=[[GOLD]][mcMMO] [[DARK_AQUA]]\u30f4\u30a1\u30f3\u30d1\u30a4\u30a2\u5438\u8840\u7d71\u8a08: [[DARK_RED]]{0}% +MOTD.PerksPrefix=[[GOLD]][mcMMO \u30d1\u30fc\u30af] +MOTD.Version=[[GOLD]][mcMMO] \u5b9f\u884c\u4e2d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3 [[DARK_AQUA]]{0} +MOTD.Website=[[GOLD]][mcMMO] [[GREEN]]{0}[[YELLOW]] - mcMMO \u30a6\u30a7\u30d6\u30b5\u30a4\u30c8 + #SMELTING Smelting.SubSkill.UnderstandingTheArt.Name=\u82b8\u8853\u3092\u7406\u89e3\u3059\u308b Smelting.SubSkill.UnderstandingTheArt.Description=\u6d1e\u7a9f\u306e\u4e2d\u3067\u88fd\u932c\u306b\u6642\u9593\u3092\u304b\u3051\u904e\u304e\u3066\u3044\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\n\u88fd\u932c\u306e\u3055\u307e\u3056\u307e\u306a\u7279\u6027\u3092\u5f37\u5316\u3057\u307e\u3059\u3002 @@ -803,17 +848,38 @@ Smelting.SubSkill.FluxMining.Stat=\u30d5\u30e9\u30c3\u30af\u30b9\u30de\u30a4\u30 Smelting.Listener=\u7cbe\u932c: Smelting.SkillName=\u7cbe\u932c -# Admin Notifications -Server.ConsoleName=[[YELLOW]][Server] -Notifications.Admin.XPRate.Start.Self=[[GRAY]]\u3042\u306a\u305f\u306f[[GOLD]]{0}x[[GRAY]]\u306b\u30b0\u30ed\u30fc\u30d0\u30ebXP\u30ec\u30fc\u30c8\u3092\u8a2d\u5b9a\u3057\u307e\u3057\u305f\u3002 -Notifications.Admin.XPRate.End.Self=[[GRAY]]XP\u30ec\u30fc\u30c8\u30a4\u30d9\u30f3\u30c8\u3092\u7d42\u4e86\u3057\u307e\u3057\u305f\u3002 -Notifications.Admin.XPRate.End.Others={0}[[GRAY]]\u306fXP\u30ec\u30fc\u30c8\u30a4\u30d9\u30f3\u30c8\u3092\u7d42\u4e86\u3057\u307e\u3057\u305f -Notifications.Admin.XPRate.Start.Others={0}[[GRAY]]\u304c{1}x\u3067\u30b0\u30ed\u30fc\u30d0\u30ebXP\u30ec\u30fc\u30c8\u30a4\u30d9\u30f3\u30c8\u3092\u958b\u59cb\u307e\u305f\u306f\u5909\u66f4\u3057\u307e\u3057\u305f -Notifications.Admin.Format.Others=[[GOLD]]([[GREEN]]mcMMO [[DARK_AQUA]]\u7ba1\u7406\u8005[[GOLD]]) [[GRAY]]{0} -Notifications.Admin.Format.Self=[[GOLD]]([[GREEN]]mcMMO[[GOLD]]) [[GRAY]]{0} - -# Event -XPRate.Event=[[GOLD]]mcMMO\u306f\u73fe\u5728XP\u30ec\u30fc\u30c8\u30a4\u30d9\u30f3\u30c8\u4e2d\u3067\u3059\uff01XP\u30ec\u30fc\u30c8\u306f{0}x\u3067\u3059\uff01 +#COMMAND DESCRIPTIONS +Commands.Description.addlevels=\u30e6\u30fc\u30b6\u30fc\u306bmcMMO\u30ec\u30d9\u30eb\u3092\u8ffd\u52a0\u3059\u308b +Commands.Description.adminchat=mcMMO\u7ba1\u7406\u8005\u30c1\u30e3\u30c3\u30c8\u306e\u30aa\u30f3\/\u30aa\u30d5\u306e\u5207\u308a\u66ff\u3048\u3001\u307e\u305f\u306f\u7ba1\u7406\u8005\u30c1\u30e3\u30c3\u30c8\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u9001\u4fe1 +Commands.Description.addxp=\u30e6\u30fc\u30b6\u30fc\u306bmcMMO XP\u3092\u8ffd\u52a0\u3059\u308b +Commands.Description.hardcore=mcMMO\u30cf\u30fc\u30c9\u30b3\u30a2\u306e\u30d1\u30fc\u30bb\u30f3\u30c6\u30fc\u30b8\u3092\u5909\u66f4\u3059\u308b\u304b\u3001\u30cf\u30fc\u30c9\u30b3\u30a2\u30e2\u30fc\u30c9\u306e\u30aa\u30f3\/\u30aa\u30d5\u3092\u5207\u308a\u66ff\u3048\u307e\u3059 +Commands.Description.inspect=\u4ed6\u306e\u30d7\u30ec\u30a4\u30e4\u30fc\u306e\u8a73\u7d30\u306amcMMO\u60c5\u5831\u3092\u898b\u308b +Commands.Description.mcability=\u53f3\u30af\u30ea\u30c3\u30af\u3067mcMMO\u30a2\u30d3\u30ea\u30c6\u30a3\u306e\u6709\u52b9\u306b\u3064\u3044\u3066\u30aa\u30f3\/\u30aa\u30d5\u3092\u5207\u308a\u66ff\u3048\u307e\u3059 +Commands.Description.mccooldown=mcMMO\u30a2\u30d3\u30ea\u30c6\u30a3\u306e\u30af\u30fc\u30eb\u30c0\u30a6\u30f3\u3092\u3059\u3079\u3066\u898b\u308b +Commands.Description.mcchatspy=mcMMO\u30d1\u30fc\u30c6\u30a3\u30fc\u30c1\u30e3\u30c3\u30c8\u306e\u30b9\u30d1\u30a4\u306b\u3064\u3044\u3066\u30aa\u30f3\/\u30aa\u30d5\u3092\u5207\u308a\u66ff\u3048\u307e\u3059 +Commands.Description.mcgod=mcMMO\u306e\u30b4\u30c3\u30c9\u30e2\u30fc\u30c9\u306e\u30aa\u30f3\/\u30aa\u30d5\u3092\u5207\u308a\u66ff\u3048\u307e\u3059 +Commands.Description.mchud=mcMMO HUD\u30b9\u30bf\u30a4\u30eb\u3092\u5909\u66f4\u3059\u308b +Commands.Description.mcmmo=mcMMO\u306e\u7c21\u5358\u306a\u8aac\u660e\u3092\u8868\u793a\u3059\u308b +Commands.Description.mcnotify=mcMMO\u30a2\u30d3\u30ea\u30c6\u30a3\u306e\u30c1\u30e3\u30c3\u30c8\u8868\u793a\u901a\u77e5\u306b\u3064\u3044\u3066\u30aa\u30f3\/\u30aa\u30d5\u3092\u5207\u308a\u66ff\u3048\u307e\u3059 +Commands.Description.mcpurge=mcMMO\u30ec\u30d9\u30eb\u306e\u306a\u3044\u30e6\u30fc\u30b6\u30fc\u304a\u3088\u3073{0}\u30f6\u6708\u4ee5\u4e0a\u63a5\u7d9a\u3057\u3066\u3044\u306a\u3044\u30e6\u30fc\u30b6\u30fc\u3092mcMMO\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u524a\u9664\u3057\u307e\u3059\u3002 +Commands.Description.mcrank=\u30d7\u30ec\u30a4\u30e4\u30fc\u306emcMMO\u30e9\u30f3\u30ad\u30f3\u30b0\u3092\u8868\u793a\u3059\u308b +Commands.Description.mcrefresh=mcMMO\u306e\u3059\u3079\u3066\u306e\u30af\u30fc\u30eb\u30c0\u30a6\u30f3\u3092\u66f4\u65b0\u3059\u308b +Commands.Description.mcremove=mcMMO\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u30e6\u30fc\u30b6\u30fc\u3092\u524a\u9664\u3059\u308b +Commands.Description.mcscoreboard=mcMMO\u30b9\u30b3\u30a2\u30dc\u30fc\u30c9\u3092\u7ba1\u7406\u3059\u308b +Commands.Description.mcstats=mcMMO\u30ec\u30d9\u30eb\u3068XP\u3092\u8868\u793a +Commands.Description.mctop=mcMMO\u30ea\u30fc\u30c0\u30fc\u30dc\u30fc\u30c9\u3092\u8868\u793a +Commands.Description.mmoedit=\u30e6\u30fc\u30b6\u30fc\u306emcMMO\u30ec\u30d9\u30eb\u3092\u7de8\u96c6 +Commands.Description.mmoupdate=mcMMO\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u53e4\u3044\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u73fe\u5728\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u79fb\u884c\u3057\u307e\u3059\u3002 +Commands.Description.mcconvert=\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u7a2e\u985e\u307e\u305f\u306f\u7d4c\u9a13\u5024\u5f0f\u306e\u7a2e\u985e\u3092\u5909\u63db\u3059\u308b +Commands.Description.mmoshowdb=\u73fe\u5728\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30bf\u30a4\u30d7\u306e\u540d\u524d\u3092\u8868\u793a\u3057\u307e\u3059\uff08\u5f8c\u3067\/mmoupdate\u3067\u4f7f\u7528\u3059\u308b\u305f\u3081\uff09 +Commands.Description.party=\u3055\u307e\u3056\u307e\u306amcMMO\u30d1\u30fc\u30c6\u30a3\u306e\u8a2d\u5b9a\u3092\u7ba1\u7406\u3059\u308b +Commands.Description.partychat=mcMMO\u30d1\u30fc\u30c6\u30a3\u30c1\u30e3\u30c3\u30c8\u306e\u30aa\u30f3\/\u30aa\u30d5\u3092\u5207\u308a\u66ff\u3048\u305f\u308a\u3001\u30d1\u30fc\u30c6\u30a3\u30c1\u30e3\u30c3\u30c8\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u4fe1\u3057\u305f\u308a\u3057\u307e\u3059 +Commands.Description.ptp=mcMMO\u30d1\u30fc\u30c6\u30a3\u30fc\u30e1\u30f3\u30d0\u30fc\u306b\u30c6\u30ec\u30dd\u30fc\u30c8\u3059\u308b +Commands.Description.Skill={0}\u306e\u8a73\u7d30\u306amcMMO\u30b9\u30ad\u30eb\u60c5\u5831\u3092\u8868\u793a\u3057\u307e\u3059 +Commands.Description.skillreset=\u30e6\u30fc\u30b6\u30fc\u306emcMMO\u30ec\u30d9\u30eb\u3092\u30ea\u30bb\u30c3\u30c8\u3059\u308b +Commands.Description.vampirism=mcMMO\u306e\u30f4\u30a1\u30f3\u30d1\u30a4\u30a2\u306e\u5272\u5408\u3092\u5909\u66f4\u3059\u308b\u304b\u3001\u307e\u305f\u306f\u30f4\u30a1\u30f3\u30d1\u30a4\u30a2\u30e2\u30fc\u30c9\u306e\u30aa\u30f3\/\u30aa\u30d5\u306b\u5207\u308a\u66ff\u3048\u307e\u3059 +Commands.Description.xplock=mcMMO XP\u30d0\u30fc\u3092\u7279\u5b9a\u306emcMMO\u30b9\u30ad\u30eb\u306b\u56fa\u5b9a\u3059\u308b +Commands.Description.xprate=mcMMO XP\u306e\u30ec\u30fc\u30c8\u3092\u5909\u66f4\u3059\u308b\u304b\u3001mcMMO XP\u306e\u30a4\u30d9\u30f3\u30c8\u3092\u958b\u59cb\u3059\u308b #UPDATE CHECKER UpdateChecker.Outdated=\u3042\u306a\u305f\u306f\u53e4\u3044mcMMO\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\uff01 @@ -839,8 +905,16 @@ Profile.Loading.Success=[[GREEN]]\u3042\u306a\u305f\u306emcMMO\u30d7\u30ed\u30d5 Profile.Loading.FailurePlayer=[[RED]]mcMMO\u306e\u30c7\u30fc\u30bf\u306e\u8aad\u307f\u8fbc\u307f\u306b\u554f\u984c\u304c\u3042\u308a\u307e\u3059\u3002[[GREEN]]{0}[[RED]]\u56de\u8aad\u307f\u8fbc\u307f\u3092\u8a66\u3057\u307e\u3057\u305f\u3002[[LIGHT_GRAY]] \u3053\u306e\u554f\u984c\u306b\u3064\u3044\u3066\u30b5\u30fc\u30d0\u30fc\u7ba1\u7406\u8005\u306b\u9023\u7d61\u3057\u3066\u304f\u3060\u3055\u3044\u3002mcMMO\u306f\u3042\u306a\u305f\u304c\u5207\u65ad\u3059\u308b\u307e\u3067\u30c7\u30fc\u30bf\u306e\u8aad\u307f\u8fbc\u307f\u3092\u7e70\u308a\u8fd4\u3057\u307e\u3059\u3002\u30c7\u30fc\u30bf\u304c\u8aad\u307f\u8fbc\u307e\u308c\u3066\u3044\u306a\u3044\u9593XP\u3092\u7372\u5f97\u3067\u304d\u306a\u3044\u304b\u3001\u30b9\u30ad\u30eb\u3092\u4f7f\u3046\u3053\u3068\u304c\u51fa\u6765\u307e\u305b\u3093\u3002 Profile.Loading.FailureNotice=[[DARK_RED]][A][[RED]] mcMMO\u306f[[YELLOW]]{0}[[RED]]\u306e\u30d7\u30ec\u30fc\u30e4\u30fc\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u8fbc\u3081\u307e\u305b\u3093\u3067\u3057\u305f\u3002 [[LIGHT_PURPLE]]\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u8a2d\u5b9a\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u308c\u307e\u3067\u306e\u8a66\u884c\u56de\u6570\u306f{1}\u56de\u3067\u3059\u3002 +#Holiday +Holiday.AprilFools.Levelup=[[GOLD]]{0}\u306f\u30ec\u30d9\u30eb[[GREEN]]{1}[[GOLD]]\u306b\u306a\u308a\u307e\u3057\u305f\u3002 +Holiday.Anniversary=[[BLUE]]{0}\u5468\u5e74\u8a18\u5ff5\uff01\n[[BLUE]]nossr50\u306e\u5168\u3066\u306e\u4ed5\u4e8b\u3068\u5168\u3066\u306e\u958b\u767a\u3092\u8a18\u5ff5\u3057\u3066\uff01 + #Reminder Messages Reminder.Squelched=[[GRAY]]\u30ea\u30de\u30a4\u30f3\u30c0\u30fc: \u3042\u306a\u305f\u306f\u73fe\u5728mcMMO\u304b\u3089\u901a\u77e5\u3092\u53d7\u3051\u53d6\u3063\u3066\u3044\u307e\u305b\u3093\u3002\u901a\u77e5\u3092\u6709\u52b9\u306b\u3059\u308b\u305f\u3081\u306b\u306f\/mcnotify\u30b3\u30de\u30f3\u30c9\u3092\u3082\u3046\u4e00\u5ea6\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u308c\u306f\u81ea\u52d5\u5316\u3055\u308c\u305f1\u6642\u9593\u3054\u3068\u306e\u901a\u77e5\u3067\u3059\u3002 #Locale -Locale.Reloaded=[[GREEN]]\u30ed\u30b1\u30fc\u30eb \u30ea\u30ed\u30fc\u30c9\uff01 \ No newline at end of file +Locale.Reloaded=[[GREEN]]\u30ed\u30b1\u30fc\u30eb \u30ea\u30ed\u30fc\u30c9\uff01 + +#Player Leveling Stuff +LevelCap.PowerLevel=[[GOLD]]([[GREEN]]mcMMO[[GOLD]]) [[RED]]{0}[[YELLOW]]\u306e\u30d1\u30ef\u30fc\u30ec\u30d9\u30eb\u306e\u30ec\u30d9\u30eb\u30ad\u30e3\u30c3\u30d7\u306b\u9054\u3057\u307e\u3057\u305f\u3002\u3053\u308c\u4ee5\u964d\u30b9\u30ad\u30eb\u306e\u30ec\u30d9\u30eb\u30a2\u30c3\u30d7\u306f\u3057\u307e\u305b\u3093\u3002 +LevelCap.Skill=[[GOLD]]([[GREEN]]mcMMO[[GOLD]]) [[GOLD]]{1}[[YELLOW]]\u306e\u30ec\u30d9\u30eb\u30ad\u30e3\u30c3\u30d7[[RED]]{0}[[YELLOW]]\u306b\u9054\u3057\u307e\u3057\u305f\u3002\u3053\u308c\u4ee5\u964d\u30b9\u30ad\u30eb\u306e\u30ec\u30d9\u30eb\u30a2\u30c3\u30d7\u306f\u3057\u307e\u305b\u3093\u3002 \ No newline at end of file From 3673d3fb7b65b1dd224905b0a2fb94873d44e4e8 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sun, 23 Jun 2019 12:00:49 -0700 Subject: [PATCH 09/26] Tree Feller bug fix --- Changelog.txt | 3 +++ pom.xml | 2 +- src/main/java/com/gmail/nossr50/listeners/BlockListener.java | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 509656459..2d58a014a 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,3 +1,6 @@ +Version 2.1.89 + Fixed a bug that could result in Tree Feller failing to remove parts of a tree + Version 2.1.88 mcMMO is now more compatible with a plugin named Project Korra mcMMO will no longer process combat triggers for damage at or below 0 diff --git a/pom.xml b/pom.xml index 5725ee2c9..c7402166f 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.88 + 2.1.89-SNAPSHOT mcMMO https://github.com/mcMMO-Dev/mcMMO diff --git a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java index d9b8361cf..e83c9f96f 100644 --- a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java @@ -193,7 +193,8 @@ public class BlockListener implements Listener { if(ExperienceConfig.getInstance().preventStoneLavaFarming()) { - if(event.getNewState().getType() != Material.OBSIDIAN && BlockUtils.shouldBeWatched(event.getNewState())) + if(event.getNewState().getType() != Material.OBSIDIAN && BlockUtils.shouldBeWatched(event.getNewState()) + && ExperienceConfig.getInstance().doesBlockGiveSkillXP(PrimarySkillType.MINING, event.getNewState().getBlockData())) { mcMMO.getPlaceStore().setTrue(event.getNewState()); } From a135e08e12f27f8ab5a1ea31ecb7df136a15b4ae Mon Sep 17 00:00:00 2001 From: nossr50 Date: Mon, 24 Jun 2019 17:32:05 -0700 Subject: [PATCH 10/26] Improved WG compatibility + Tree Feller will now damage unbreaking enchant tools again --- Changelog.txt | 10 ++ pom.xml | 2 +- .../nossr50/commands/admin/PlayerDebug.java | 13 ++ src/main/java/com/gmail/nossr50/mcMMO.java | 9 +- .../skills/woodcutting/Woodcutting.java | 5 +- .../nossr50/worldguard/WorldGuardManager.java | 8 -- .../nossr50/worldguard/WorldGuardUtils.java | 120 ++++++++++++++---- 7 files changed, 125 insertions(+), 42 deletions(-) create mode 100644 src/main/java/com/gmail/nossr50/commands/admin/PlayerDebug.java diff --git a/Changelog.txt b/Changelog.txt index 2d58a014a..3a986acf6 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,5 +1,15 @@ Version 2.1.89 + When using WG with mcMMO, mcMMO now examines WG during runtime to determine if its a compatible version or not, see the notes Fixed a bug that could result in Tree Feller failing to remove parts of a tree + Updated Japanese locale (thanks snake) + + NOTES: + https://mcmmo.org/wiki/World_guard - A list of WG flags + It is not necessary to have WG installed, but if you do have WG installed mcMMO hooks into it to provide some additional features. + + Previously mcMMO used to determine if WG was compatible just by checking to see if it was version 7 of WG, however version 7 of WG is not guaranteed to be compatible as necessary classes that mcMMO hooks into were added during its development and some users are still running early dev versions of WG7. + In order to decrease the chance of error, mcMMO now uses reflection when checking to see if WG is compatible in addition to checking its version number, if its not compatible mcMMO will print a message and refrain from hooking into WG. + WG is an optional dependency for mcMMO, and unfortunately before this change if mcMMO thought you were running a compatible version of WG and it turned out you weren't then mcMMO would not function correctly. Version 2.1.88 mcMMO is now more compatible with a plugin named Project Korra diff --git a/pom.xml b/pom.xml index c7402166f..202964971 100755 --- a/pom.xml +++ b/pom.xml @@ -173,7 +173,7 @@ com.sk89q.worldguard worldguard-core - 7.0.0-SNAPSHOT + 7.0.1-SNAPSHOT com.sk89q.worldguard diff --git a/src/main/java/com/gmail/nossr50/commands/admin/PlayerDebug.java b/src/main/java/com/gmail/nossr50/commands/admin/PlayerDebug.java new file mode 100644 index 000000000..9ced7e818 --- /dev/null +++ b/src/main/java/com/gmail/nossr50/commands/admin/PlayerDebug.java @@ -0,0 +1,13 @@ +package com.gmail.nossr50.commands.admin; + +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; + +public class PlayerDebug implements CommandExecutor { + + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + return false; + } +} diff --git a/src/main/java/com/gmail/nossr50/mcMMO.java b/src/main/java/com/gmail/nossr50/mcMMO.java index 9186e2206..11ac2d4bc 100644 --- a/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/src/main/java/com/gmail/nossr50/mcMMO.java @@ -45,6 +45,7 @@ import com.gmail.nossr50.util.scoreboards.ScoreboardManager; import com.gmail.nossr50.util.skills.RankUtils; import com.gmail.nossr50.util.upgrade.UpgradeManager; import com.gmail.nossr50.worldguard.WorldGuardManager; +import com.gmail.nossr50.worldguard.WorldGuardUtils; import com.google.common.base.Charsets; import net.shatteredlands.shatt.backup.ZipLibrary; import org.bstats.bukkit.Metrics; @@ -309,8 +310,12 @@ public class mcMMO extends JavaPlugin { @Override public void onLoad() { - if(getServer().getPluginManager().getPlugin("WorldGuard") != null) - WorldGuardManager.getInstance().registerFlags(); + if(getServer().getPluginManager().getPlugin("WorldGuard") != null) { + //Make sure WG is compatible before proceeding + if(WorldGuardUtils.isWorldGuardLoaded()) { + WorldGuardManager.getInstance().registerFlags(); + } + } } /** diff --git a/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java b/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java index 03459492e..5e130772c 100644 --- a/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java +++ b/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java @@ -148,9 +148,8 @@ public final class Woodcutting { * @return True if the tool can sustain the durability loss */ protected static boolean handleDurabilityLoss(Set treeFellerBlocks, ItemStack inHand) { - - if((inHand.getItemMeta().getEnchants().get(Enchantment.DURABILITY) != null && inHand.getItemMeta().getEnchants().get(Enchantment.DURABILITY) >= 1) - || (inHand.getItemMeta() != null && inHand.getItemMeta().isUnbreakable())) { + //Treat the NBT tag for unbreakable and the durability enchant differently + if(inHand.getItemMeta() != null && inHand.getItemMeta().isUnbreakable()) { return true; } diff --git a/src/main/java/com/gmail/nossr50/worldguard/WorldGuardManager.java b/src/main/java/com/gmail/nossr50/worldguard/WorldGuardManager.java index 896aad675..248753153 100644 --- a/src/main/java/com/gmail/nossr50/worldguard/WorldGuardManager.java +++ b/src/main/java/com/gmail/nossr50/worldguard/WorldGuardManager.java @@ -24,11 +24,6 @@ public class WorldGuardManager { return instance; } - public WorldGuardManager() - { - - } - public boolean hasMainFlag(Player player) { if(player == null) @@ -37,7 +32,6 @@ public class WorldGuardManager { BukkitPlayer localPlayer = BukkitAdapter.adapt(player); com.sk89q.worldedit.util.Location loc = localPlayer.getLocation(); - //WorldGuardPlugin worldGuard = getWorldGuard(); RegionContainer container = WorldGuard.getInstance().getPlatform().getRegionContainer(); RegionQuery query = container.createQuery(); @@ -101,8 +95,6 @@ public class WorldGuardManager { FlagRegistry registry = WorldGuard.getInstance().getFlagRegistry(); try { // register our flag with the registry - /*registry.register(WorldGuardFlags.MCMMO_ENABLE_WG_FLAG); - registry.register(WorldGuardFlags.MCMMO_XP_WG_FLAG);*/ registry.register(WorldGuardFlags.MCMMO_ENABLE_WG_FLAG); registry.register(WorldGuardFlags.MCMMO_XP_WG_FLAG); registry.register(WorldGuardFlags.MCMMO_HARDCORE_WG_FLAG); diff --git a/src/main/java/com/gmail/nossr50/worldguard/WorldGuardUtils.java b/src/main/java/com/gmail/nossr50/worldguard/WorldGuardUtils.java index d04ee6c11..e33e1e508 100644 --- a/src/main/java/com/gmail/nossr50/worldguard/WorldGuardUtils.java +++ b/src/main/java/com/gmail/nossr50/worldguard/WorldGuardUtils.java @@ -4,58 +4,122 @@ import com.gmail.nossr50.mcMMO; import com.sk89q.worldguard.bukkit.WorldGuardPlugin; import org.bukkit.plugin.Plugin; +import java.util.ArrayList; + import static org.bukkit.Bukkit.getServer; public class WorldGuardUtils { private static WorldGuardPlugin worldGuardPluginRef; private static boolean isLoaded = false; - private static boolean hasWarned = false; + private static boolean detectedIncompatibleWG = false; + private static final ArrayList WGClassList; + + static { + /* + These are the classes mcMMO tries to hook into for WG support, if any of them are missing it is safe to consider WG is not compatible + com.sk89q.worldedit.bukkit.BukkitAdapter + com.sk89q.worldedit.bukkit.BukkitPlayer + com.sk89q.worldguard.WorldGuard + com.sk89q.worldguard.bukkit.WorldGuardPlugin + com.sk89q.worldguard.protection.flags.registry.FlagConflictException + com.sk89q.worldguard.protection.flags.registry.FlagRegistry + com.sk89q.worldguard.protection.regions.RegionContainer + com.sk89q.worldguard.protection.regions.RegionQuery + */ + + WGClassList = new ArrayList<>(); + WGClassList.add("com.sk89q.worldedit.bukkit.BukkitAdapter"); + WGClassList.add("com.sk89q.worldedit.bukkit.BukkitPlayer"); + WGClassList.add("com.sk89q.worldguard.WorldGuard"); + WGClassList.add("com.sk89q.worldguard.bukkit.WorldGuardPlugin"); + WGClassList.add("com.sk89q.worldguard.protection.flags.registry.FlagConflictException"); + WGClassList.add("com.sk89q.worldguard.protection.flags.registry.FlagRegistry"); + WGClassList.add("com.sk89q.worldguard.protection.regions.RegionContainer"); + WGClassList.add("com.sk89q.worldguard.protection.regions.RegionQuery"); + } public static boolean isWorldGuardLoaded() { + if(detectedIncompatibleWG) + return false; + WorldGuardPlugin plugin = getWorldGuard(); - try { - // WorldGuard may not be loaded - if (plugin == null) { - return false; // Maybe you want throw an exception instead - } - } catch (Exception e) { - e.printStackTrace(); - //Silently Fail - //mcMMO.p.getLogger().severe("Failed to detect worldguard."); - return false; - } - - - return true; + return plugin == null; } + /** + * Gets the instance of the WG plugin if its compatible + * Results are cached + * @return the instance of WG plugin, null if its not compatible or isn't present + */ private static WorldGuardPlugin getWorldGuard() { + //WG plugin reference is already cached so just return it if(isLoaded) return worldGuardPluginRef; + //Grab WG if it exists Plugin plugin = getServer().getPluginManager().getPlugin("WorldGuard"); - if(plugin instanceof WorldGuardPlugin) - { - if(plugin.getDescription().getVersion().startsWith("7")) + if(plugin == null) { + //WG is not present + detectedIncompatibleWG = true; + mcMMO.p.getLogger().info("WorldGuard was not detected."); + } else { + //Check that its actually of class WorldGuardPlugin + if(plugin instanceof WorldGuardPlugin) { - worldGuardPluginRef = (WorldGuardPlugin) plugin; - - if(worldGuardPluginRef != null) - isLoaded = true; - - } else { - if(!hasWarned) + if(isCompatibleVersion(plugin)) { - mcMMO.p.getLogger().severe("mcMMO only supports WorldGuard version 7! Make sure you have WG 7! This warning will not appear again."); - hasWarned = true; + worldGuardPluginRef = (WorldGuardPlugin) plugin; + isLoaded = true; + } + } else { + //Plugin is not of the expected type + markWGIncompatible(); + } + } + + + return worldGuardPluginRef; + } + + /** + * Checks to make sure the version of WG installed is compatible + * Does this by checking for necessary WG classes via Reflection + * This does not guarantee compatibility, but it should help reduce the chance that mcMMO tries to hook into WG and its not compatible + * @return true if the version of WG appears to be compatible + */ + private static boolean isCompatibleVersion(Plugin plugin) { + //Check that the version of WG is at least version 7.xx + if(!plugin.getDescription().getVersion().startsWith("7")) { + markWGIncompatible(); + } else { + //Use Reflection to check for a class not present in all versions of WG7 + for(String classString : WGClassList) { + try { + Class checkForClass = Class.forName(classString); + detectedIncompatibleWG = false; //In case this was set to true previously + } catch (ClassNotFoundException e) { + mcMMO.p.getLogger().severe("Missing WorldGuard class - "+classString); + markWGIncompatible(); + break; //Break out of the loop } } } - return worldGuardPluginRef; + return detectedIncompatibleWG; + } + + /** + * Mark WG as being incompatible to avoid unnecessary operations + */ + private static void markWGIncompatible() { + mcMMO.p.getLogger().severe("You are using a version of WG that is not compatible with mcMMO, " + + "WG features for mcMMO will be disabled. mcMMO requires you to be using a new version of WG7 " + + "in order for it to use WG features. Not all versions of WG7 are compatible."); + mcMMO.p.getLogger().severe("mcMMO will continue to function normally, but if you wish to use WG support you must use a compatible version."); + detectedIncompatibleWG = true; } } From 764b4c20f599eb4cc60da4a4a8fe2adb3ebccbc9 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Mon, 24 Jun 2019 17:49:02 -0700 Subject: [PATCH 11/26] Tools with durability enchant will be damaged properly by super abilities again (at a reduced rated) --- Changelog.txt | 13 +++++++++---- .../com/gmail/nossr50/util/skills/SkillUtils.java | 3 +-- .../gmail/nossr50/worldguard/WorldGuardManager.java | 10 +++++++--- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 3a986acf6..9f9949d65 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,16 +1,21 @@ Version 2.1.89 - When using WG with mcMMO, mcMMO now examines WG during runtime to determine if its a compatible version or not, see the notes - Fixed a bug that could result in Tree Feller failing to remove parts of a tree + When using WorldGuard (WG) with mcMMO, mcMMO now examines WG more carefully to determine if it is a compatible version or not, see the notes. Keep in mind WG is optional and not needed to run mcMMO. + Fixed a bug that could result in Tree Feller failing to remove parts of a tree in snowy biomes. (This fix won't apply retroactively to old trees, see the notes) Updated Japanese locale (thanks snake) + Tree Feller and other Super Abilities will damage tools with the Enchantment named 'Durability/Unbreaking' again, this does not apply to the NBT tag named Unbreaking (Unbreaking NBT tag is safe from damage however, try not to confuse them as they share the same name) NOTES: - https://mcmmo.org/wiki/World_guard - A list of WG flags + https://mcmmo.org/wiki/World_guard - A list of WG flags supported by mcMMO. It is not necessary to have WG installed, but if you do have WG installed mcMMO hooks into it to provide some additional features. - Previously mcMMO used to determine if WG was compatible just by checking to see if it was version 7 of WG, however version 7 of WG is not guaranteed to be compatible as necessary classes that mcMMO hooks into were added during its development and some users are still running early dev versions of WG7. In order to decrease the chance of error, mcMMO now uses reflection when checking to see if WG is compatible in addition to checking its version number, if its not compatible mcMMO will print a message and refrain from hooking into WG. WG is an optional dependency for mcMMO, and unfortunately before this change if mcMMO thought you were running a compatible version of WG and it turned out you weren't then mcMMO would not function correctly. + In a prior patch I removed damage on tools if they had Unbreaking NBT or Unbreaking Enchantment, at the time I made this change I did not realize they were different things and just shared the same name, this patch fixes this mistake. My intention was to prevent damage on tools with the NBT unbreaking tag which makes an item never suffer from durability loss. + mcMMO reduces damage to tools from super abilities if they have the "Durability/Unbreaking" enchantment already, this behaviour has been in mcMMO for a long time. + + There was a bug fixed in this patch that prevents an issue where Tree Feller was not removing all blocks left behind, unfortunately this will only affect new trees made in the world. The only trees that suffered from this bug were ones in snowy areas that had snow form on them. + Version 2.1.88 mcMMO is now more compatible with a plugin named Project Korra mcMMO will no longer process combat triggers for damage at or below 0 diff --git a/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java b/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java index c3247606d..7bc395adc 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java @@ -243,8 +243,7 @@ public class SkillUtils { * @param maxDamageModifier the amount to adjust the max damage by */ public static void handleDurabilityChange(ItemStack itemStack, double durabilityModifier, double maxDamageModifier) { - if((itemStack.getItemMeta().getEnchants().get(Enchantment.DURABILITY) != null && itemStack.getItemMeta().getEnchants().get(Enchantment.DURABILITY) >= 1) - || (itemStack.getItemMeta() != null && itemStack.getItemMeta().isUnbreakable())) { + if(itemStack.getItemMeta() != null && itemStack.getItemMeta().isUnbreakable()) { return; } diff --git a/src/main/java/com/gmail/nossr50/worldguard/WorldGuardManager.java b/src/main/java/com/gmail/nossr50/worldguard/WorldGuardManager.java index 248753153..e8fb5475c 100644 --- a/src/main/java/com/gmail/nossr50/worldguard/WorldGuardManager.java +++ b/src/main/java/com/gmail/nossr50/worldguard/WorldGuardManager.java @@ -16,6 +16,13 @@ import static org.bukkit.Bukkit.getServer; public class WorldGuardManager { private static WorldGuardManager instance; private WorldGuardPlugin worldGuardPluginRef; + private RegionContainer container; + + public WorldGuardManager() { + if(WorldGuardUtils.isWorldGuardLoaded()) { + container = WorldGuard.getInstance().getPlatform().getRegionContainer(); + } + } public static WorldGuardManager getInstance() { if(instance == null) @@ -33,7 +40,6 @@ public class WorldGuardManager { com.sk89q.worldedit.util.Location loc = localPlayer.getLocation(); //WorldGuardPlugin worldGuard = getWorldGuard(); - RegionContainer container = WorldGuard.getInstance().getPlatform().getRegionContainer(); RegionQuery query = container.createQuery(); //ApplicableRegionSet set = query.getApplicableRegions(loc); @@ -50,7 +56,6 @@ public class WorldGuardManager { com.sk89q.worldedit.util.Location loc = localPlayer.getLocation(); //WorldGuardPlugin worldGuard = getWorldGuard(); - RegionContainer container = WorldGuard.getInstance().getPlatform().getRegionContainer(); RegionQuery query = container.createQuery(); //ApplicableRegionSet set = query.getApplicableRegions(loc); @@ -67,7 +72,6 @@ public class WorldGuardManager { com.sk89q.worldedit.util.Location loc = localPlayer.getLocation(); //WorldGuardPlugin worldGuard = getWorldGuard(); - RegionContainer container = WorldGuard.getInstance().getPlatform().getRegionContainer(); RegionQuery query = container.createQuery(); //ApplicableRegionSet set = query.getApplicableRegions(loc); From 68ad507be351c624ef9c1ccb55d7fff09965b1f5 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Mon, 24 Jun 2019 20:17:35 -0700 Subject: [PATCH 12/26] Skills which used to unlock at level 5 now unlock at level 1 and some tweaks to ranks of other skills, and length scaling for super abilities. Early game boost has also been modified. --- Changelog.txt | 41 ++++++++++ pom.xml | 2 +- .../config/experience/ExperienceConfig.java | 2 +- .../datatypes/skills/SubSkillType.java | 4 +- .../skills/woodcutting/Woodcutting.java | 38 +++++++--- .../woodcutting/WoodcuttingManager.java | 27 ++----- .../nossr50/util/player/PlayerLevelUtils.java | 55 ++++++-------- src/main/resources/advanced.yml | 6 +- src/main/resources/experience.yml | 3 +- src/main/resources/skillranks.yml | 76 +++++++++++-------- 10 files changed, 153 insertions(+), 101 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 9f9949d65..d0ced844b 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,10 +1,50 @@ Version 2.1.89 + Many changes were made to this version that affect default values in the config, read the notes carefully if you wish to apply these changes. They are optional. + mcMMO is compatible with the new 1.14.3, in addition to this it is still compatible with 1.14.2, 1.14.1, 1.14, and 1.13.2. This did not require any changes to be made to mcMMO, but I thought I'd add this to the notes for those wondering. + + The default level for players has been changed back to 0 from 1 (you can change it back to 1 by editing 'Skills.General.StartingLevel' in advanced.yml) if you wish to apply this change read the notes + Super Abilities now scale in length up to level 100/1000 instead of 50/500 by default (you can edit this in advanced.yml under 'Skills.General.Ability.Length.xxx') + Early Game Boost now only applies when leveling from level 0 to level 1 + Removed the config setting 'MaxLevelMultiplier' from experience.yml as it is no longer used. + + Many skills which used to unlock at level 5/50 now unlock at level 1 instead + Arrow Retrieval now unlocks at level 1 in both Standard and RetroMode + Skill Shot now unlocks at level 1 in both Standard and RetroMode + Dodge now unlocks at level 1 in both Standard and RetroMode + Critical Strikes now unlocks at level 1 in both Standard and RetroMode + Armor Impact now unlocks at level 1 in both Standard and RetroMode + Beast Lore now unlocks at level 1 in both Standard and RetroMode + Call Of The Wild now unlocks at level 1 in both Standard and RetroMode + Scrap Collector now unlocks at level 1 in both Standard and RetroMode + Treasure Hunter now unlocks at level 1 in both Standard and RetroMode + Rupture now unlocks at level 1 in both Standard and RetroMode + Iron Arm Style now unlocks at level 1 in both Standard and RetroMode + Harvest Lumber now unlocks at level 1 in both Standard and RetroMode + Archaeology now unlocks at level 1 in both Standard and RetroMode + Repair Mastery now unlocks at level 1 in both Standard and RetroMode + Double Drops (Herbalism and Mining) now have ranks and unlock at level 1 in both Standard and RetroMode + Concoctions rank 2 now unlocks at Level 1 for both Standard and RetroMode + Serrated Strikes now unlocks at levels 5/50 instead of 10/100 + Berserk now unlocks at levels 5/50 instead of 10/100 When using WorldGuard (WG) with mcMMO, mcMMO now examines WG more carefully to determine if it is a compatible version or not, see the notes. Keep in mind WG is optional and not needed to run mcMMO. Fixed a bug that could result in Tree Feller failing to remove parts of a tree in snowy biomes. (This fix won't apply retroactively to old trees, see the notes) Updated Japanese locale (thanks snake) Tree Feller and other Super Abilities will damage tools with the Enchantment named 'Durability/Unbreaking' again, this does not apply to the NBT tag named Unbreaking (Unbreaking NBT tag is safe from damage however, try not to confuse them as they share the same name) + Added new setting 'ExploitFix.TreeFellerReducedXP' to experience.yml + Tree Feller will no longer give full XP for each block destroyed and instead give diminishing returns on XP for each block removed. You can turn this off by setting 'ExploitFix.TreeFellerReducedXP' in experience.yml to false NOTES: + Editing your config files is not required for this patch (and never will be), however I would highly recommend it. Read the notes below this line carefully. + If you want to update to this patch easily and you don't mind default config values, delete skillranks.yml, advanced.yml, and experience.yml before starting your server with 2.1.89 of mcMMO applied. + Many skills now unlock at level 1 and the default starting level is back to 0. It is recommended you change this number from 1 to 0 manually by editing 'Skills.General.StartingLevel' in advanced.yml or deleting advanced.yml and generating a new file when 2.1.89 starts. + It is recommended you make the manual edits to skillranks.yml to apply this change or delete skillranks.yml and a new one will be generated once you start 2.1.89. + + Early Game Boost was used to help players get to level 5 quickly by boosting their XP until they got there, this caused some confusion as they appeared to be 'learning a skill' for multiple levels, on RetroMode this lasted until level 50. + I have changed Early Game Boost to only last from level 0-1 on both RetroMode and Standard, and now important skills are unlocked at level 1. + I was going to wait until 2.2 was done to deploy this change, but 2.2 is some time away and the previous system was causing some confusion. + Early Game Boost gives players extra XP for skills that are level 0, you can turn this system off by setting 'EarlyGameBoost.Enabled' in experience.yml to false + Early Game Boost will show 'Learning a new skill...' if XP bars are enabled + https://mcmmo.org/wiki/World_guard - A list of WG flags supported by mcMMO. It is not necessary to have WG installed, but if you do have WG installed mcMMO hooks into it to provide some additional features. Previously mcMMO used to determine if WG was compatible just by checking to see if it was version 7 of WG, however version 7 of WG is not guaranteed to be compatible as necessary classes that mcMMO hooks into were added during its development and some users are still running early dev versions of WG7. @@ -14,6 +54,7 @@ Version 2.1.89 In a prior patch I removed damage on tools if they had Unbreaking NBT or Unbreaking Enchantment, at the time I made this change I did not realize they were different things and just shared the same name, this patch fixes this mistake. My intention was to prevent damage on tools with the NBT unbreaking tag which makes an item never suffer from durability loss. mcMMO reduces damage to tools from super abilities if they have the "Durability/Unbreaking" enchantment already, this behaviour has been in mcMMO for a long time. + Tree Feller will now give reduced XP per block destroyed by Tree Feller and will never go below 1 XP per block, you can turn this off with 'ExploitFix.TreeFellerReducedXP' in experience.yml There was a bug fixed in this patch that prevents an issue where Tree Feller was not removing all blocks left behind, unfortunately this will only affect new trees made in the world. The only trees that suffered from this bug were ones in snowy areas that had snow form on them. Version 2.1.88 diff --git a/pom.xml b/pom.xml index 202964971..866f23df0 100755 --- a/pom.xml +++ b/pom.xml @@ -167,7 +167,7 @@ org.spigotmc spigot-api - 1.14.2-R0.1-SNAPSHOT + 1.14.3-SNAPSHOT provided diff --git a/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java b/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java index 641b0e4a7..052cf43b6 100644 --- a/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java +++ b/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java @@ -138,7 +138,6 @@ public class ExperienceConfig extends AutoUpdateConfigLoader { } public boolean isEarlyGameBoostEnabled() { return config.getBoolean("EarlyGameBoost.Enabled", true); } - public double getEarlyGameBoostMultiplier() { return config.getDouble("EarlyGameBoost.MaxLevelMultiplier", 0.05D); } /* * FORMULA SETTINGS @@ -151,6 +150,7 @@ public class ExperienceConfig extends AutoUpdateConfigLoader { public boolean isFishingExploitingPrevented() { return config.getBoolean("ExploitFix.Fishing", true); } public boolean isAcrobaticsExploitingPrevented() { return config.getBoolean("ExploitFix.Acrobatics", true); } + public boolean isTreeFellerXPReduced() { return config.getBoolean("ExploitFix.TreeFellerReducedXP", true); } /* Curve settings */ public FormulaType getFormulaType() { return FormulaType.getFormulaType(config.getString("Experience_Formula.Curve")); } diff --git a/src/main/java/com/gmail/nossr50/datatypes/skills/SubSkillType.java b/src/main/java/com/gmail/nossr50/datatypes/skills/SubSkillType.java index f87712d9c..ec1613a32 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/skills/SubSkillType.java +++ b/src/main/java/com/gmail/nossr50/datatypes/skills/SubSkillType.java @@ -41,7 +41,7 @@ public enum SubSkillType { FISHING_SHAKE(1), /* Herbalism */ - HERBALISM_DOUBLE_DROPS, + HERBALISM_DOUBLE_DROPS(1), HERBALISM_FARMERS_DIET(5), HERBALISM_GREEN_TERRA(1), HERBALISM_GREEN_THUMB(4), @@ -52,7 +52,7 @@ public enum SubSkillType { MINING_BIGGER_BOMBS(1), MINING_BLAST_MINING(8), MINING_DEMOLITIONS_EXPERTISE(1), - MINING_DOUBLE_DROPS, + MINING_DOUBLE_DROPS(1), MINING_SUPER_BREAKER(1), /* Repair */ diff --git a/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java b/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java index 5e130772c..9b08beab7 100644 --- a/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java +++ b/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java @@ -10,7 +10,6 @@ import com.gmail.nossr50.util.skills.SkillUtils; import org.bukkit.Material; import org.bukkit.block.BlockFace; import org.bukkit.block.BlockState; -import org.bukkit.enchantments.Enchantment; import org.bukkit.inventory.ItemStack; import java.util.ArrayList; @@ -19,25 +18,17 @@ import java.util.Set; public final class Woodcutting { public static int treeFellerThreshold = Config.getInstance().getTreeFellerThreshold(); - - protected static boolean treeFellerReachedThreshold = false; - protected enum ExperienceGainMethod { - DEFAULT, - TREE_FELLER, - } - private Woodcutting() {} /** * Retrieves the experience reward from a log * * @param blockState Log being broken - * @param experienceGainMethod How the log is being broken * @return Amount of experience */ - protected static int getExperienceFromLog(BlockState blockState, ExperienceGainMethod experienceGainMethod) { + protected static int getExperienceFromLog(BlockState blockState) { if (mcMMO.getModManager().isCustomLog(blockState)) { return mcMMO.getModManager().getBlock(blockState).getXpGain(); } @@ -45,6 +36,33 @@ public final class Woodcutting { return ExperienceConfig.getInstance().getXp(PrimarySkillType.WOODCUTTING, blockState.getType()); } + /** + * Retrieves the experience reward from logging via Tree Feller + * Experience is reduced per log processed so far + * Experience is only reduced if the config option to reduce Tree Feller XP is set + * Experience per log will not fall below 1 unless the experience for that log is set to 0 in the config + * + * @param blockState Log being broken + * @param woodCount how many logs have given out XP for this tree feller so far + * @return Amount of experience + */ + protected static int processTreeFellerXPGains(BlockState blockState, int woodCount) { + int rawXP = ExperienceConfig.getInstance().getXp(PrimarySkillType.WOODCUTTING, blockState.getType()); + + if(rawXP <= 0) + return 0; + + if(ExperienceConfig.getInstance().isTreeFellerXPReduced()) { + int reducedXP = 1 + (woodCount * 5); + rawXP = Math.max(1, rawXP - reducedXP); + return rawXP; + } else { + return ExperienceConfig.getInstance().getXp(PrimarySkillType.WOODCUTTING, blockState.getType()); + } + } + + + /** * Checks for double drops * diff --git a/src/main/java/com/gmail/nossr50/skills/woodcutting/WoodcuttingManager.java b/src/main/java/com/gmail/nossr50/skills/woodcutting/WoodcuttingManager.java index fc65fb450..f82e943ab 100644 --- a/src/main/java/com/gmail/nossr50/skills/woodcutting/WoodcuttingManager.java +++ b/src/main/java/com/gmail/nossr50/skills/woodcutting/WoodcuttingManager.java @@ -9,7 +9,6 @@ import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.datatypes.skills.SuperAbilityType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.SkillManager; -import com.gmail.nossr50.skills.woodcutting.Woodcutting.ExperienceGainMethod; import com.gmail.nossr50.util.*; import com.gmail.nossr50.util.player.NotificationManager; import com.gmail.nossr50.util.random.RandomChanceUtil; @@ -54,7 +53,7 @@ public class WoodcuttingManager extends SkillManager { * @param blockState Block being broken */ public void woodcuttingBlockCheck(BlockState blockState) { - int xp = Woodcutting.getExperienceFromLog(blockState, ExperienceGainMethod.DEFAULT); + int xp = Woodcutting.getExperienceFromLog(blockState); switch (blockState.getType()) { case BROWN_MUSHROOM_BLOCK: @@ -116,6 +115,7 @@ public class WoodcuttingManager extends SkillManager { private void dropBlocks(Set treeFellerBlocks) { Player player = getPlayer(); int xp = 0; + int processedLogCount = 0; for (BlockState blockState : treeFellerBlocks) { Block block = blockState.getBlock(); @@ -126,30 +126,18 @@ public class WoodcuttingManager extends SkillManager { Material material = blockState.getType(); + //TODO: Update this to drop the correct items/blocks via NMS if (material == Material.BROWN_MUSHROOM_BLOCK || material == Material.RED_MUSHROOM_BLOCK) { - xp += Woodcutting.getExperienceFromLog(blockState, ExperienceGainMethod.TREE_FELLER); + xp += Woodcutting.processTreeFellerXPGains(blockState, processedLogCount); Misc.dropItems(Misc.getBlockCenter(blockState), block.getDrops()); - } - else if (mcMMO.getModManager().isCustomLog(blockState)) { - if (canGetDoubleDrops()) { - Woodcutting.checkForDoubleDrop(blockState); - } - - CustomBlock customBlock = mcMMO.getModManager().getBlock(blockState); - xp = customBlock.getXpGain(); - + } else if (mcMMO.getModManager().isCustomLeaf(blockState)) { Misc.dropItems(Misc.getBlockCenter(blockState), block.getDrops()); - } - else if (mcMMO.getModManager().isCustomLeaf(blockState)) { - Misc.dropItems(Misc.getBlockCenter(blockState), block.getDrops()); - } - else { - + } else { if (BlockUtils.isLog(blockState)) { if (canGetDoubleDrops()) { Woodcutting.checkForDoubleDrop(blockState); } - xp += Woodcutting.getExperienceFromLog(blockState, ExperienceGainMethod.TREE_FELLER); + xp += Woodcutting.processTreeFellerXPGains(blockState, processedLogCount); Misc.dropItems(Misc.getBlockCenter(blockState), block.getDrops()); } if (BlockUtils.isLeaves(blockState)) { @@ -159,6 +147,7 @@ public class WoodcuttingManager extends SkillManager { blockState.setType(Material.AIR); blockState.update(true); + processedLogCount+=1; } applyXpGain(xp, XPGainReason.PVE); diff --git a/src/main/java/com/gmail/nossr50/util/player/PlayerLevelUtils.java b/src/main/java/com/gmail/nossr50/util/player/PlayerLevelUtils.java index a032fcfb0..1f0cba2f1 100644 --- a/src/main/java/com/gmail/nossr50/util/player/PlayerLevelUtils.java +++ b/src/main/java/com/gmail/nossr50/util/player/PlayerLevelUtils.java @@ -1,43 +1,38 @@ package com.gmail.nossr50.util.player; -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; -import java.util.HashMap; - public class PlayerLevelUtils { - HashMap earlyGameBoostCutoffs; - - public PlayerLevelUtils() - { - earlyGameBoostCutoffs = new HashMap<>(); - calculateEarlyGameBoostCutoffs(); - } - - private void calculateEarlyGameBoostCutoffs() - { - for(PrimarySkillType primarySkillType : PrimarySkillType.values()) - { - int levelCap = Config.getInstance().getLevelCap(primarySkillType); - int cap; - - if(levelCap == Integer.MAX_VALUE || levelCap <= 0) - { - cap = Config.getInstance().getIsRetroMode() ? 50 : 5; - } else { - cap = (int) (levelCap * ExperienceConfig.getInstance().getEarlyGameBoostMultiplier()); - } - - earlyGameBoostCutoffs.put(primarySkillType, cap); - } - } +// HashMap earlyGameBoostCutoffs; +// +// public PlayerLevelUtils() +// { +// earlyGameBoostCutoffs = new HashMap<>(); +// calculateEarlyGameBoostCutoffs(); +// } +// private void calculateEarlyGameBoostCutoffs() +// { +// for(PrimarySkillType primarySkillType : PrimarySkillType.values()) +// { +// int levelCap = Config.getInstance().getLevelCap(primarySkillType); +// int cap; +// +// if(levelCap == Integer.MAX_VALUE || levelCap <= 0) +// { +// cap = Config.getInstance().getIsRetroMode() ? 50 : 5; +// } else { +// cap = (int) (levelCap * ExperienceConfig.getInstance().getEarlyGameBoostMultiplier()); +// } +// +// earlyGameBoostCutoffs.put(primarySkillType, cap); +// } +// } public int getEarlyGameCutoff(PrimarySkillType primarySkillType) { - return earlyGameBoostCutoffs.get(primarySkillType); + return 1; } /** diff --git a/src/main/resources/advanced.yml b/src/main/resources/advanced.yml index 6e528e90f..b6c98834e 100644 --- a/src/main/resources/advanced.yml +++ b/src/main/resources/advanced.yml @@ -77,14 +77,14 @@ Feedback: SendCopyOfMessageToChat: true Skills: General: - StartingLevel: 1 + StartingLevel: 0 Ability: Length: Standard: - CapLevel: 50 + CapLevel: 100 IncreaseLevel: 5 RetroMode: - CapLevel: 500 + CapLevel: 1000 IncreaseLevel: 50 EnchantBuff: 5 # IncreaseLevel: This setting will determine when the length of every ability gets longer with 1 second diff --git a/src/main/resources/experience.yml b/src/main/resources/experience.yml index d2a291463..585066949 100644 --- a/src/main/resources/experience.yml +++ b/src/main/resources/experience.yml @@ -24,8 +24,6 @@ # The bar is one solid piece EarlyGameBoost: Enabled: true - #Used to determine the cap of the max boot, with default level cap it will be 5 on standard, and 50 on retro - MaxLevelMultiplier: 0.05 ExploitFix: UnsafeEnchantments: false # Prevent many exploits related to fishing @@ -33,6 +31,7 @@ ExploitFix: EndermanEndermiteFarms: true Acrobatics: true LavaStoneAndCobbleFarming: true + TreeFellerReducedXP: true Experience_Bars: # Turn this to false if you wanna disable XP bars Enable: true diff --git a/src/main/resources/skillranks.yml b/src/main/resources/skillranks.yml index 8bdbd953a..0e51b10e4 100644 --- a/src/main/resources/skillranks.yml +++ b/src/main/resources/skillranks.yml @@ -14,7 +14,7 @@ Alchemy: Concoctions: Standard: Rank_1: 0 - Rank_2: 25 + Rank_2: 1 Rank_3: 35 Rank_4: 50 Rank_5: 65 @@ -23,7 +23,7 @@ Alchemy: Rank_8: 100 RetroMode: Rank_1: 0 - Rank_2: 250 + Rank_2: 1 Rank_3: 350 Rank_4: 500 Rank_5: 650 @@ -56,12 +56,12 @@ Archery: Rank_10: 1000 ArrowRetrieval: Standard: - Rank_1: 2 + Rank_1: 1 RetroMode: - Rank_1: 20 + Rank_1: 1 SkillShot: Standard: - Rank_1: 5 + Rank_1: 1 Rank_2: 10 Rank_3: 15 Rank_4: 20 @@ -82,7 +82,7 @@ Archery: Rank_19: 95 Rank_20: 100 RetroMode: - Rank_1: 50 + Rank_1: 1 Rank_2: 100 Rank_3: 150 Rank_4: 200 @@ -105,9 +105,9 @@ Archery: Acrobatics: Dodge: Standard: - Rank_1: 2 + Rank_1: 1 RetroMode: - Rank_1: 20 + Rank_1: 1 Axes: AxesLimitBreak: Standard: @@ -139,9 +139,9 @@ Axes: Rank_1: 50 CriticalStrikes: Standard: - Rank_1: 2 + Rank_1: 1 RetroMode: - Rank_1: 20 + Rank_1: 1 GreaterImpact: Standard: Rank_1: 25 @@ -149,7 +149,7 @@ Axes: Rank_1: 250 ArmorImpact: Standard: - Rank_1: 5 + Rank_1: 1 Rank_2: 10 Rank_3: 15 Rank_4: 20 @@ -170,7 +170,7 @@ Axes: Rank_19: 95 Rank_20: 100 RetroMode: - Rank_1: 50 + Rank_1: 1 Rank_2: 100 Rank_3: 150 Rank_4: 200 @@ -204,9 +204,9 @@ Axes: Taming: BeastLore: Standard: - Rank_1: 2 + Rank_1: 1 RetroMode: - Rank_1: 20 + Rank_1: 1 Gore: Standard: Rank_1: 15 @@ -214,9 +214,9 @@ Taming: Rank_1: 150 CallOfTheWild: Standard: - Rank_1: 5 + Rank_1: 1 RetroMode: - Rank_1: 50 + Rank_1: 1 Pummel: Standard: Rank_1: 20 @@ -284,7 +284,7 @@ Smelting: Salvage: ScrapCollector: Standard: - Rank_1: 2 + Rank_1: 1 Rank_2: 10 Rank_3: 15 Rank_4: 20 @@ -293,7 +293,7 @@ Salvage: Rank_7: 35 Rank_8: 40 RetroMode: - Rank_1: 20 + Rank_1: 1 Rank_2: 100 Rank_3: 150 Rank_4: 200 @@ -321,6 +321,11 @@ Salvage: Rank_7: 850 Rank_8: 1000 Mining: + DoubleDrops: + Standard: + Rank_1: 1 + RetroMode: + Rank_1: 1 SuperBreaker: Standard: Rank_1: 5 @@ -358,6 +363,11 @@ Mining: Rank_7: 850 Rank_8: 1000 Herbalism: + DoubleDrops: + Standard: + Rank_1: 1 + RetroMode: + Rank_1: 1 GreenTerra: Standard: Rank_1: 5 @@ -423,7 +433,7 @@ Fishing: Rank_5: 1000 TreasureHunter: Standard: - Rank_1: 10 + Rank_1: 1 Rank_2: 25 Rank_3: 35 Rank_4: 50 @@ -432,7 +442,7 @@ Fishing: Rank_7: 85 Rank_8: 100 RetroMode: - Rank_1: 100 + Rank_1: 1 Rank_2: 250 Rank_3: 350 Rank_4: 500 @@ -478,20 +488,20 @@ Swords: Rank_1: 200 Rupture: Standard: - Rank_1: 5 + Rank_1: 1 Rank_2: 15 Rank_3: 75 Rank_4: 90 RetroMode: - Rank_1: 50 + Rank_1: 1 Rank_2: 150 Rank_3: 750 Rank_4: 900 SerratedStrikes: Standard: - Rank_1: 10 + Rank_1: 5 RetroMode: - Rank_1: 100 + Rank_1: 50 Unarmed: UnarmedLimitBreak: Standard: @@ -518,9 +528,9 @@ Unarmed: Rank_10: 1000 Berserk: Standard: - Rank_1: 10 + Rank_1: 5 RetroMode: - Rank_1: 100 + Rank_1: 50 ArrowDeflect: Standard: Rank_1: 20 @@ -538,13 +548,13 @@ Unarmed: Rank_1: 600 IronArmStyle: Standard: - Rank_1: 2 + Rank_1: 1 Rank_2: 25 Rank_3: 50 Rank_4: 75 Rank_5: 100 RetroMode: - Rank_1: 20 + Rank_1: 1 Rank_2: 250 Rank_3: 500 Rank_4: 750 @@ -595,7 +605,7 @@ Woodcutting: Standard: Rank_1: 1 RetroMode: - Rank_1: 10 + Rank_1: 1 LeafBlower: Standard: Rank_1: 15 @@ -613,7 +623,7 @@ Excavation: Rank_1: 50 Archaeology: Standard: - Rank_1: 5 + Rank_1: 1 Rank_2: 25 Rank_3: 35 Rank_4: 50 @@ -622,7 +632,7 @@ Excavation: Rank_7: 85 Rank_8: 100 RetroMode: - Rank_1: 50 + Rank_1: 1 Rank_2: 250 Rank_3: 350 Rank_4: 500 @@ -633,9 +643,9 @@ Excavation: Repair: RepairMastery: Standard: - Rank_1: 20 + Rank_1: 1 RetroMode: - Rank_1: 200 + Rank_1: 1 SuperRepair: Standard: Rank_1: 40 From 913323245cc438879502cf031ac2309454b51f9e Mon Sep 17 00:00:00 2001 From: nossr50 Date: Mon, 24 Jun 2019 20:27:50 -0700 Subject: [PATCH 13/26] Archaeology now does something --- Changelog.txt | 13 +++++++------ .../skills/excavation/ExcavationManager.java | 12 ++++++++++++ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index d0ced844b..419e2f432 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -6,7 +6,14 @@ Version 2.1.89 Super Abilities now scale in length up to level 100/1000 instead of 50/500 by default (you can edit this in advanced.yml under 'Skills.General.Ability.Length.xxx') Early Game Boost now only applies when leveling from level 0 to level 1 Removed the config setting 'MaxLevelMultiplier' from experience.yml as it is no longer used. + When finding a treasure via Excavation players have a 1-8% chance to have a small amount vanilla experience orbs to be found alongside the treasure, the chance and number of orbs are based on the players Archaeology rank + When using WorldGuard (WG) with mcMMO, mcMMO now examines WG more carefully to determine if it is a compatible version or not, see the notes. Keep in mind WG is optional and not needed to run mcMMO. + Fixed a bug that could result in Tree Feller failing to remove parts of a tree in snowy biomes. (This fix won't apply retroactively to old trees, see the notes) + Updated Japanese locale (thanks snake) + Tree Feller and other Super Abilities will damage tools with the Enchantment named 'Durability/Unbreaking' again, this does not apply to the NBT tag named Unbreaking (Unbreaking NBT tag is safe from damage however, try not to confuse them as they share the same name) + Added new setting 'ExploitFix.TreeFellerReducedXP' to experience.yml + Tree Feller will no longer give full XP for each block destroyed and instead give diminishing returns on XP for each block removed. You can turn this off by setting 'ExploitFix.TreeFellerReducedXP' in experience.yml to false Many skills which used to unlock at level 5/50 now unlock at level 1 instead Arrow Retrieval now unlocks at level 1 in both Standard and RetroMode Skill Shot now unlocks at level 1 in both Standard and RetroMode @@ -26,12 +33,6 @@ Version 2.1.89 Concoctions rank 2 now unlocks at Level 1 for both Standard and RetroMode Serrated Strikes now unlocks at levels 5/50 instead of 10/100 Berserk now unlocks at levels 5/50 instead of 10/100 - When using WorldGuard (WG) with mcMMO, mcMMO now examines WG more carefully to determine if it is a compatible version or not, see the notes. Keep in mind WG is optional and not needed to run mcMMO. - Fixed a bug that could result in Tree Feller failing to remove parts of a tree in snowy biomes. (This fix won't apply retroactively to old trees, see the notes) - Updated Japanese locale (thanks snake) - Tree Feller and other Super Abilities will damage tools with the Enchantment named 'Durability/Unbreaking' again, this does not apply to the NBT tag named Unbreaking (Unbreaking NBT tag is safe from damage however, try not to confuse them as they share the same name) - Added new setting 'ExploitFix.TreeFellerReducedXP' to experience.yml - Tree Feller will no longer give full XP for each block destroyed and instead give diminishing returns on XP for each block removed. You can turn this off by setting 'ExploitFix.TreeFellerReducedXP' in experience.yml to false NOTES: Editing your config files is not required for this patch (and never will be), however I would highly recommend it. Read the notes below this line carefully. diff --git a/src/main/java/com/gmail/nossr50/skills/excavation/ExcavationManager.java b/src/main/java/com/gmail/nossr50/skills/excavation/ExcavationManager.java index 077caded0..44d34b1ea 100644 --- a/src/main/java/com/gmail/nossr50/skills/excavation/ExcavationManager.java +++ b/src/main/java/com/gmail/nossr50/skills/excavation/ExcavationManager.java @@ -10,9 +10,12 @@ import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.random.RandomChanceUtil; +import com.gmail.nossr50.util.skills.RankUtils; import com.gmail.nossr50.util.skills.SkillUtils; import org.bukkit.Location; import org.bukkit.block.BlockState; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.ExperienceOrb; import org.bukkit.entity.Player; import java.util.List; @@ -40,6 +43,15 @@ public class ExcavationManager extends SkillManager { for (ExcavationTreasure treasure : treasures) { if (skillLevel >= treasure.getDropLevel() && RandomChanceUtil.checkRandomChanceExecutionSuccess(getPlayer(), PrimarySkillType.EXCAVATION, treasure.getDropChance())) { + + int rank = RankUtils.getRank(getPlayer(), SubSkillType.EXCAVATION_ARCHAEOLOGY); + + //Spawn Vanilla XP orbs if a dice roll succeeds + if(RandomChanceUtil.rollDice(rank, 100)) { + ExperienceOrb experienceOrb = (ExperienceOrb) getPlayer().getWorld().spawnEntity(location, EntityType.EXPERIENCE_ORB); + experienceOrb.setExperience(rank); + } + xp += treasure.getXp(); Misc.dropItem(location, treasure.getDrop()); } From d347fa95120d6a81ffca188a3062396563ed4aac Mon Sep 17 00:00:00 2001 From: nossr50 Date: Mon, 24 Jun 2019 20:54:26 -0700 Subject: [PATCH 14/26] Add information about Archaeology to /excavation and tweak some locale strings related to excavation --- Changelog.txt | 4 ++++ .../com/gmail/nossr50/commands/skills/ExcavationCommand.java | 5 +++++ src/main/resources/locale/locale_en_US.properties | 3 ++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Changelog.txt b/Changelog.txt index 419e2f432..b302d19bb 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -7,6 +7,8 @@ Version 2.1.89 Early Game Boost now only applies when leveling from level 0 to level 1 Removed the config setting 'MaxLevelMultiplier' from experience.yml as it is no longer used. When finding a treasure via Excavation players have a 1-8% chance to have a small amount vanilla experience orbs to be found alongside the treasure, the chance and number of orbs are based on the players Archaeology rank + Tweaked the locale string 'Excavation.SubSkill.Archaeology.Description' + Added locale string 'Excavation.SubSkill.Archaeology.Stat' When using WorldGuard (WG) with mcMMO, mcMMO now examines WG more carefully to determine if it is a compatible version or not, see the notes. Keep in mind WG is optional and not needed to run mcMMO. Fixed a bug that could result in Tree Feller failing to remove parts of a tree in snowy biomes. (This fix won't apply retroactively to old trees, see the notes) @@ -52,6 +54,8 @@ Version 2.1.89 In order to decrease the chance of error, mcMMO now uses reflection when checking to see if WG is compatible in addition to checking its version number, if its not compatible mcMMO will print a message and refrain from hooking into WG. WG is an optional dependency for mcMMO, and unfortunately before this change if mcMMO thought you were running a compatible version of WG and it turned out you weren't then mcMMO would not function correctly. + Archaeology does something now, it will be tweaked again in the future. Previously rank 1 of Archaeology was required to find treasures but that was all it did, now each rank of Archaeology also adds a small chance to find experience orbs when a player finds treasure. + In a prior patch I removed damage on tools if they had Unbreaking NBT or Unbreaking Enchantment, at the time I made this change I did not realize they were different things and just shared the same name, this patch fixes this mistake. My intention was to prevent damage on tools with the NBT unbreaking tag which makes an item never suffer from durability loss. mcMMO reduces damage to tools from super abilities if they have the "Durability/Unbreaking" enchantment already, this behaviour has been in mcMMO for a long time. diff --git a/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java index 0274c03fd..3d3c07f1e 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java @@ -50,6 +50,11 @@ public class ExcavationCommand extends SkillCommand { //messages.add(LocaleLoader.getString("Excavation.Effect.Length", gigaDrillBreakerLength) + (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", gigaDrillBreakerLengthEndurance) : "")); } + if(Permissions.isSubSkillEnabled(player, SubSkillType.EXCAVATION_ARCHAEOLOGY)) { + String rank = String.valueOf(RankUtils.getRank(player, SubSkillType.EXCAVATION_ARCHAEOLOGY)); + messages.add(getStatMessage(SubSkillType.EXCAVATION_ARCHAEOLOGY, rank, rank)); + } + return messages; } diff --git a/src/main/resources/locale/locale_en_US.properties b/src/main/resources/locale/locale_en_US.properties index e502a310d..5533bda8d 100644 --- a/src/main/resources/locale/locale_en_US.properties +++ b/src/main/resources/locale/locale_en_US.properties @@ -217,7 +217,8 @@ Excavation.SubSkill.GigaDrillBreaker.Name=Giga Drill Breaker Excavation.SubSkill.GigaDrillBreaker.Description=3x Drop Rate, 3x EXP, +Speed Excavation.SubSkill.GigaDrillBreaker.Stat=Giga Drill Breaker Duration Excavation.SubSkill.Archaeology.Name=Archaeology -Excavation.SubSkill.Archaeology.Description=Unearth the secrets of the land! +Excavation.SubSkill.Archaeology.Description=Unearth the secrets of the land! Find treasure and experience orbs! +Excavation.SubSkill.Archaeology.Stat={0}% chance to find {1} experience orbs alongside treasure Excavation.Listener=Excavation: Excavation.SkillName=EXCAVATION Excavation.Skills.GigaDrillBreaker.Off=**Giga Drill Breaker has worn off** From 2dda0bf27a16ee282a620730897cd932df912655 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Mon, 24 Jun 2019 21:25:51 -0700 Subject: [PATCH 15/26] Fix some WG logic + Archaeology stat display --- Changelog.txt | 1 + .../java/com/gmail/nossr50/worldguard/WorldGuardUtils.java | 4 ++-- src/main/resources/locale/locale_en_US.properties | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index b302d19bb..e25e31c3f 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -9,6 +9,7 @@ Version 2.1.89 When finding a treasure via Excavation players have a 1-8% chance to have a small amount vanilla experience orbs to be found alongside the treasure, the chance and number of orbs are based on the players Archaeology rank Tweaked the locale string 'Excavation.SubSkill.Archaeology.Description' Added locale string 'Excavation.SubSkill.Archaeology.Stat' + Added locale string 'Excavation.SubSkill.Archaeology.Stat.Extra' When using WorldGuard (WG) with mcMMO, mcMMO now examines WG more carefully to determine if it is a compatible version or not, see the notes. Keep in mind WG is optional and not needed to run mcMMO. Fixed a bug that could result in Tree Feller failing to remove parts of a tree in snowy biomes. (This fix won't apply retroactively to old trees, see the notes) diff --git a/src/main/java/com/gmail/nossr50/worldguard/WorldGuardUtils.java b/src/main/java/com/gmail/nossr50/worldguard/WorldGuardUtils.java index e33e1e508..8841ca69f 100644 --- a/src/main/java/com/gmail/nossr50/worldguard/WorldGuardUtils.java +++ b/src/main/java/com/gmail/nossr50/worldguard/WorldGuardUtils.java @@ -43,9 +43,9 @@ public class WorldGuardUtils { if(detectedIncompatibleWG) return false; - WorldGuardPlugin plugin = getWorldGuard(); + WorldGuardPlugin worldGuardPlugin = getWorldGuard(); - return plugin == null; + return isLoaded; } /** diff --git a/src/main/resources/locale/locale_en_US.properties b/src/main/resources/locale/locale_en_US.properties index 5533bda8d..7c1bd2e5e 100644 --- a/src/main/resources/locale/locale_en_US.properties +++ b/src/main/resources/locale/locale_en_US.properties @@ -218,7 +218,8 @@ Excavation.SubSkill.GigaDrillBreaker.Description=3x Drop Rate, 3x EXP, +Speed Excavation.SubSkill.GigaDrillBreaker.Stat=Giga Drill Breaker Duration Excavation.SubSkill.Archaeology.Name=Archaeology Excavation.SubSkill.Archaeology.Description=Unearth the secrets of the land! Find treasure and experience orbs! -Excavation.SubSkill.Archaeology.Stat={0}% chance to find {1} experience orbs alongside treasure +Excavation.SubSkill.Archaeology.Stat=Archaelogy Experience Orb Rate +Excavation.SubSkill.Archaeology.Stat.Extra={0}% chance to find {1} experience orbs alongside treasure Excavation.Listener=Excavation: Excavation.SkillName=EXCAVATION Excavation.Skills.GigaDrillBreaker.Off=**Giga Drill Breaker has worn off** From ee2a1b332e45a779de5f9961b8079e528c455154 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Mon, 24 Jun 2019 22:30:20 -0700 Subject: [PATCH 16/26] tweak Archaeology rewards --- .../commands/skills/ExcavationCommand.java | 10 +++++++--- .../skills/excavation/ExcavationManager.java | 18 ++++++++++++++---- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java index 3d3c07f1e..a729258dc 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java @@ -3,8 +3,10 @@ package com.gmail.nossr50.commands.skills; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.skills.excavation.ExcavationManager; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.TextComponentFactory; +import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.util.skills.RankUtils; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.entity.Player; @@ -43,6 +45,9 @@ public class ExcavationCommand extends SkillCommand { protected List statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) { List messages = new ArrayList(); + + ExcavationManager excavationManager = UserManager.getPlayer(player).getExcavationManager(); + if (canGigaDrill) { messages.add(getStatMessage(SubSkillType.EXCAVATION_GIGA_DRILL_BREAKER, gigaDrillBreakerLength) + (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", gigaDrillBreakerLengthEndurance) : "")); @@ -50,9 +55,8 @@ public class ExcavationCommand extends SkillCommand { //messages.add(LocaleLoader.getString("Excavation.Effect.Length", gigaDrillBreakerLength) + (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", gigaDrillBreakerLengthEndurance) : "")); } - if(Permissions.isSubSkillEnabled(player, SubSkillType.EXCAVATION_ARCHAEOLOGY)) { - String rank = String.valueOf(RankUtils.getRank(player, SubSkillType.EXCAVATION_ARCHAEOLOGY)); - messages.add(getStatMessage(SubSkillType.EXCAVATION_ARCHAEOLOGY, rank, rank)); + if(canUseSubskill(player, SubSkillType.EXCAVATION_ARCHAEOLOGY)) { + messages.add(getStatMessage(SubSkillType.EXCAVATION_ARCHAEOLOGY, percent.format(excavationManager.getArchaelogyExperienceOrbChance()), String.valueOf(excavationManager.getExperienceOrbsReward()))); } return messages; diff --git a/src/main/java/com/gmail/nossr50/skills/excavation/ExcavationManager.java b/src/main/java/com/gmail/nossr50/skills/excavation/ExcavationManager.java index 44d34b1ea..65036d27a 100644 --- a/src/main/java/com/gmail/nossr50/skills/excavation/ExcavationManager.java +++ b/src/main/java/com/gmail/nossr50/skills/excavation/ExcavationManager.java @@ -44,12 +44,10 @@ public class ExcavationManager extends SkillManager { if (skillLevel >= treasure.getDropLevel() && RandomChanceUtil.checkRandomChanceExecutionSuccess(getPlayer(), PrimarySkillType.EXCAVATION, treasure.getDropChance())) { - int rank = RankUtils.getRank(getPlayer(), SubSkillType.EXCAVATION_ARCHAEOLOGY); - //Spawn Vanilla XP orbs if a dice roll succeeds - if(RandomChanceUtil.rollDice(rank, 100)) { + if(RandomChanceUtil.rollDice(getArchaelogyExperienceOrbChance(), 100)) { ExperienceOrb experienceOrb = (ExperienceOrb) getPlayer().getWorld().spawnEntity(location, EntityType.EXPERIENCE_ORB); - experienceOrb.setExperience(rank); + experienceOrb.setExperience(getExperienceOrbsReward()); } xp += treasure.getXp(); @@ -62,6 +60,18 @@ public class ExcavationManager extends SkillManager { applyXpGain(xp, XPGainReason.PVE); } + public int getExperienceOrbsReward() { + return 5 * getArchaeologyRank(); + } + + public double getArchaelogyExperienceOrbChance() { + return getArchaeologyRank() * 2; + } + + public int getArchaeologyRank() { + return RankUtils.getRank(getPlayer(), SubSkillType.EXCAVATION_ARCHAEOLOGY); + } + public void printExcavationDebug(Player player, BlockState blockState) { if (Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.EXCAVATION_ARCHAEOLOGY)) { From ccb86264d9ece8b1d4f6f44812c199d629ac5ae1 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Mon, 24 Jun 2019 22:31:21 -0700 Subject: [PATCH 17/26] Update excavation command --- .../com/gmail/nossr50/commands/skills/ExcavationCommand.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java index a729258dc..1228c3387 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java @@ -45,7 +45,6 @@ public class ExcavationCommand extends SkillCommand { protected List statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) { List messages = new ArrayList(); - ExcavationManager excavationManager = UserManager.getPlayer(player).getExcavationManager(); if (canGigaDrill) { From 421d6cff3bcfefd82f276b3dc9d4f7804b769041 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Mon, 24 Jun 2019 22:48:22 -0700 Subject: [PATCH 18/26] Tweak archaeology numbers --- Changelog.txt | 1 + .../gmail/nossr50/commands/skills/ExcavationCommand.java | 6 +++++- .../nossr50/skills/excavation/ExcavationManager.java | 2 +- src/main/resources/locale/locale_en_US.properties | 8 ++++---- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index e25e31c3f..0ff87395a 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -10,6 +10,7 @@ Version 2.1.89 Tweaked the locale string 'Excavation.SubSkill.Archaeology.Description' Added locale string 'Excavation.SubSkill.Archaeology.Stat' Added locale string 'Excavation.SubSkill.Archaeology.Stat.Extra' + Tweaked the locale string 'Fishing.SubSkill.MasterAngler.Stat' When using WorldGuard (WG) with mcMMO, mcMMO now examines WG more carefully to determine if it is a compatible version or not, see the notes. Keep in mind WG is optional and not needed to run mcMMO. Fixed a bug that could result in Tree Feller failing to remove parts of a tree in snowy biomes. (This fix won't apply retroactively to old trees, see the notes) diff --git a/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java index 1228c3387..2d9093311 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java @@ -55,7 +55,11 @@ public class ExcavationCommand extends SkillCommand { } if(canUseSubskill(player, SubSkillType.EXCAVATION_ARCHAEOLOGY)) { - messages.add(getStatMessage(SubSkillType.EXCAVATION_ARCHAEOLOGY, percent.format(excavationManager.getArchaelogyExperienceOrbChance()), String.valueOf(excavationManager.getExperienceOrbsReward()))); + messages.add(getStatMessage(false, false, SubSkillType.EXCAVATION_ARCHAEOLOGY, + percent.format(excavationManager.getArchaelogyExperienceOrbChance() / 100.0D))); + messages.add(getStatMessage(true, false, SubSkillType.EXCAVATION_ARCHAEOLOGY, + String.valueOf(excavationManager.getExperienceOrbsReward()))); + } return messages; diff --git a/src/main/java/com/gmail/nossr50/skills/excavation/ExcavationManager.java b/src/main/java/com/gmail/nossr50/skills/excavation/ExcavationManager.java index 65036d27a..994d84866 100644 --- a/src/main/java/com/gmail/nossr50/skills/excavation/ExcavationManager.java +++ b/src/main/java/com/gmail/nossr50/skills/excavation/ExcavationManager.java @@ -61,7 +61,7 @@ public class ExcavationManager extends SkillManager { } public int getExperienceOrbsReward() { - return 5 * getArchaeologyRank(); + return 1 * getArchaeologyRank(); } public double getArchaelogyExperienceOrbChance() { diff --git a/src/main/resources/locale/locale_en_US.properties b/src/main/resources/locale/locale_en_US.properties index 7c1bd2e5e..1e1d0c5b0 100644 --- a/src/main/resources/locale/locale_en_US.properties +++ b/src/main/resources/locale/locale_en_US.properties @@ -217,9 +217,9 @@ Excavation.SubSkill.GigaDrillBreaker.Name=Giga Drill Breaker Excavation.SubSkill.GigaDrillBreaker.Description=3x Drop Rate, 3x EXP, +Speed Excavation.SubSkill.GigaDrillBreaker.Stat=Giga Drill Breaker Duration Excavation.SubSkill.Archaeology.Name=Archaeology -Excavation.SubSkill.Archaeology.Description=Unearth the secrets of the land! Find treasure and experience orbs! -Excavation.SubSkill.Archaeology.Stat=Archaelogy Experience Orb Rate -Excavation.SubSkill.Archaeology.Stat.Extra={0}% chance to find {1} experience orbs alongside treasure +Excavation.SubSkill.Archaeology.Description=Unearth the secrets of the land! High skill levels increase your odds of finding experience orbs when you find treasure! +Excavation.SubSkill.Archaeology.Stat=Archaelogy Experience Orb Chance +Excavation.SubSkill.Archaeology.Stat.Extra=Archaeoloy Experience Orb Amount Excavation.Listener=Excavation: Excavation.SkillName=EXCAVATION Excavation.Skills.GigaDrillBreaker.Off=**Giga Drill Breaker has worn off** @@ -251,7 +251,7 @@ Fishing.SubSkill.FishermansDiet.Description=Improves hunger restored from fished Fishing.SubSkill.FishermansDiet.Stat=Fisherman's Diet:[[GREEN]] Rank {0} Fishing.SubSkill.MasterAngler.Name=Master Angler Fishing.SubSkill.MasterAngler.Description=Improves chance of getting a bite while fishing -Fishing.SubSkill.MasterAngler.Stat=Added Bite Chance at your current location: [[GREEN]]+[[YELLOW]]{0} +Fishing.SubSkill.MasterAngler.Stat=Added Bite Chance at your current location: [[GREEN]]+{0} Fishing.SubSkill.IceFishing.Name=Ice Fishing Fishing.SubSkill.IceFishing.Description=Allows you to fish in icy biomes Fishing.SubSkill.IceFishing.Stat=Ice Fishing From d9b84b0ab3aa7f1257f9729a22c72d26ea5387c4 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Mon, 24 Jun 2019 23:25:15 -0700 Subject: [PATCH 19/26] Check mining rank before processing double drops --- Changelog.txt | 4 ++-- .../nossr50/commands/skills/MiningCommand.java | 2 +- .../nossr50/datatypes/player/McMMOPlayer.java | 1 - .../nossr50/listeners/EntityListener.java | 6 ++++-- src/main/java/com/gmail/nossr50/mcMMO.java | 7 ++----- .../nossr50/skills/mining/MiningManager.java | 6 +++++- .../nossr50/skills/salvage/SalvageManager.java | 5 ++++- .../skills/woodcutting/WoodcuttingManager.java | 1 - .../nossr50/worldguard/WorldGuardManager.java | 18 ++++-------------- .../nossr50/worldguard/WorldGuardUtils.java | 6 +++--- 10 files changed, 25 insertions(+), 31 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 0ff87395a..f7e66f702 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -15,7 +15,7 @@ Version 2.1.89 When using WorldGuard (WG) with mcMMO, mcMMO now examines WG more carefully to determine if it is a compatible version or not, see the notes. Keep in mind WG is optional and not needed to run mcMMO. Fixed a bug that could result in Tree Feller failing to remove parts of a tree in snowy biomes. (This fix won't apply retroactively to old trees, see the notes) Updated Japanese locale (thanks snake) - Tree Feller and other Super Abilities will damage tools with the Enchantment named 'Durability/Unbreaking' again, this does not apply to the NBT tag named Unbreaking (Unbreaking NBT tag is safe from damage however, try not to confuse them as they share the same name) + Tree Feller and other Super Abilities will damage tools with the Enchantment named 'Durability/Unbreaking' again, this does not apply to the NBT tag named Ubreakable (Unbreakable NBT tag is safe from damage however, try not to confuse them as they share similar names) Added new setting 'ExploitFix.TreeFellerReducedXP' to experience.yml Tree Feller will no longer give full XP for each block destroyed and instead give diminishing returns on XP for each block removed. You can turn this off by setting 'ExploitFix.TreeFellerReducedXP' in experience.yml to false Many skills which used to unlock at level 5/50 now unlock at level 1 instead @@ -58,7 +58,7 @@ Version 2.1.89 Archaeology does something now, it will be tweaked again in the future. Previously rank 1 of Archaeology was required to find treasures but that was all it did, now each rank of Archaeology also adds a small chance to find experience orbs when a player finds treasure. - In a prior patch I removed damage on tools if they had Unbreaking NBT or Unbreaking Enchantment, at the time I made this change I did not realize they were different things and just shared the same name, this patch fixes this mistake. My intention was to prevent damage on tools with the NBT unbreaking tag which makes an item never suffer from durability loss. + In a prior patch I removed damage on tools if they had Unbreakable NBT or Unbreaking Enchantment, at the time I made this change I did not realize they were different things and just shared the same name, this patch fixes this mistake. My intention was to prevent damage on tools with the NBT unbreakable tag which makes an item never suffer from durability loss. mcMMO reduces damage to tools from super abilities if they have the "Durability/Unbreaking" enchantment already, this behaviour has been in mcMMO for a long time. Tree Feller will now give reduced XP per block destroyed by Tree Feller and will never go below 1 XP per block, you can turn this off with 'ExploitFix.TreeFellerReducedXP' in experience.yml diff --git a/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java index 1f2b06805..ee7710aa6 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java @@ -72,7 +72,7 @@ public class MiningCommand extends SkillCommand { canBiggerBombs = RankUtils.hasUnlockedSubskill(player, SubSkillType.MINING_BIGGER_BOMBS) && Permissions.biggerBombs(player); canBlast = RankUtils.hasUnlockedSubskill(player, SubSkillType.MINING_BLAST_MINING) && Permissions.remoteDetonation(player); canDemoExpert = RankUtils.hasUnlockedSubskill(player, SubSkillType.MINING_DEMOLITIONS_EXPERTISE) && Permissions.demolitionsExpertise(player); - canDoubleDrop = Permissions.isSubSkillEnabled(player, SubSkillType.MINING_DOUBLE_DROPS) && !skill.getDoubleDropsDisabled(); + canDoubleDrop = canUseSubskill(player, SubSkillType.MINING_DOUBLE_DROPS); canSuperBreaker = RankUtils.hasUnlockedSubskill(player, SubSkillType.MINING_SUPER_BREAKER) && Permissions.superBreaker(player); } diff --git a/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java b/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java index 8131772f2..d6ed18ee8 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java +++ b/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java @@ -41,7 +41,6 @@ import com.gmail.nossr50.skills.woodcutting.WoodcuttingManager; import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; -import com.gmail.nossr50.util.StringUtils; import com.gmail.nossr50.util.experience.ExperienceBarManager; import com.gmail.nossr50.util.player.NotificationManager; import com.gmail.nossr50.util.player.UserManager; diff --git a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java index 276dcd7d8..87f5dac56 100644 --- a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java @@ -32,10 +32,12 @@ import org.bukkit.OfflinePlayer; import org.bukkit.block.Block; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.*; -import org.bukkit.event.*; +import org.bukkit.event.Cancellable; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; import org.bukkit.event.entity.*; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; -import org.bukkit.event.entity.EntityDamageEvent.DamageModifier; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.PotionMeta; import org.bukkit.metadata.FixedMetadataValue; diff --git a/src/main/java/com/gmail/nossr50/mcMMO.java b/src/main/java/com/gmail/nossr50/mcMMO.java index 11ac2d4bc..00460dce3 100644 --- a/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/src/main/java/com/gmail/nossr50/mcMMO.java @@ -45,7 +45,6 @@ import com.gmail.nossr50.util.scoreboards.ScoreboardManager; import com.gmail.nossr50.util.skills.RankUtils; import com.gmail.nossr50.util.upgrade.UpgradeManager; import com.gmail.nossr50.worldguard.WorldGuardManager; -import com.gmail.nossr50.worldguard.WorldGuardUtils; import com.google.common.base.Charsets; import net.shatteredlands.shatt.backup.ZipLibrary; import org.bstats.bukkit.Metrics; @@ -311,10 +310,7 @@ public class mcMMO extends JavaPlugin { public void onLoad() { if(getServer().getPluginManager().getPlugin("WorldGuard") != null) { - //Make sure WG is compatible before proceeding - if(WorldGuardUtils.isWorldGuardLoaded()) { - WorldGuardManager.getInstance().registerFlags(); - } + WorldGuardManager.getInstance().registerFlags(); } } @@ -338,6 +334,7 @@ public class mcMMO extends JavaPlugin { placeStore.saveAll(); // Save our metadata placeStore.cleanUp(); // Cleanup empty metadata stores } + catch (Exception e) { e.printStackTrace(); } debug("Canceling all tasks..."); diff --git a/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java b/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java index d5ddc13c7..490ba011b 100644 --- a/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java +++ b/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java @@ -59,6 +59,10 @@ public class MiningManager extends SkillManager { return getSkillLevel() >= BlastMining.getBiggerBombsUnlockLevel() && Permissions.biggerBombs(getPlayer()); } + public boolean canDoubleDrop() { + return RankUtils.hasUnlockedSubskill(getPlayer(), SubSkillType.MINING_DOUBLE_DROPS) && Permissions.isSubSkillEnabled(getPlayer(), SubSkillType.MINING_DOUBLE_DROPS); + } + /** * Process double drops & XP gain for Mining. * @@ -77,7 +81,7 @@ public class MiningManager extends SkillManager { SkillUtils.handleDurabilityChange(getPlayer().getInventory().getItemInMainHand(), Config.getInstance().getAbilityToolDamage()); } - if(!Config.getInstance().getDoubleDropsEnabled(PrimarySkillType.MINING, blockState.getType())) + if(!Config.getInstance().getDoubleDropsEnabled(PrimarySkillType.MINING, blockState.getType()) || !canDoubleDrop()) return; boolean silkTouch = player.getInventory().getItemInMainHand().containsEnchantment(Enchantment.SILK_TOUCH); diff --git a/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java b/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java index ae778e74b..bc7a80983 100644 --- a/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java +++ b/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java @@ -11,7 +11,10 @@ import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.skills.salvage.salvageables.Salvageable; -import com.gmail.nossr50.util.*; +import com.gmail.nossr50.util.EventUtils; +import com.gmail.nossr50.util.Misc; +import com.gmail.nossr50.util.Permissions; +import com.gmail.nossr50.util.StringUtils; import com.gmail.nossr50.util.player.NotificationManager; import com.gmail.nossr50.util.random.RandomChanceSkillStatic; import com.gmail.nossr50.util.random.RandomChanceUtil; diff --git a/src/main/java/com/gmail/nossr50/skills/woodcutting/WoodcuttingManager.java b/src/main/java/com/gmail/nossr50/skills/woodcutting/WoodcuttingManager.java index f82e943ab..81b4a0b86 100644 --- a/src/main/java/com/gmail/nossr50/skills/woodcutting/WoodcuttingManager.java +++ b/src/main/java/com/gmail/nossr50/skills/woodcutting/WoodcuttingManager.java @@ -2,7 +2,6 @@ package com.gmail.nossr50.skills.woodcutting; import com.gmail.nossr50.datatypes.experience.XPGainReason; import com.gmail.nossr50.datatypes.interactions.NotificationType; -import com.gmail.nossr50.datatypes.mods.CustomBlock; import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType; diff --git a/src/main/java/com/gmail/nossr50/worldguard/WorldGuardManager.java b/src/main/java/com/gmail/nossr50/worldguard/WorldGuardManager.java index e8fb5475c..b017afb55 100644 --- a/src/main/java/com/gmail/nossr50/worldguard/WorldGuardManager.java +++ b/src/main/java/com/gmail/nossr50/worldguard/WorldGuardManager.java @@ -6,7 +6,6 @@ import com.sk89q.worldguard.WorldGuard; import com.sk89q.worldguard.bukkit.WorldGuardPlugin; import com.sk89q.worldguard.protection.flags.registry.FlagConflictException; import com.sk89q.worldguard.protection.flags.registry.FlagRegistry; -import com.sk89q.worldguard.protection.regions.RegionContainer; import com.sk89q.worldguard.protection.regions.RegionQuery; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; @@ -16,13 +15,6 @@ import static org.bukkit.Bukkit.getServer; public class WorldGuardManager { private static WorldGuardManager instance; private WorldGuardPlugin worldGuardPluginRef; - private RegionContainer container; - - public WorldGuardManager() { - if(WorldGuardUtils.isWorldGuardLoaded()) { - container = WorldGuard.getInstance().getPlatform().getRegionContainer(); - } - } public static WorldGuardManager getInstance() { if(instance == null) @@ -40,7 +32,7 @@ public class WorldGuardManager { com.sk89q.worldedit.util.Location loc = localPlayer.getLocation(); //WorldGuardPlugin worldGuard = getWorldGuard(); - RegionQuery query = container.createQuery(); + RegionQuery query = WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery(); //ApplicableRegionSet set = query.getApplicableRegions(loc); @@ -56,7 +48,7 @@ public class WorldGuardManager { com.sk89q.worldedit.util.Location loc = localPlayer.getLocation(); //WorldGuardPlugin worldGuard = getWorldGuard(); - RegionQuery query = container.createQuery(); + RegionQuery query = WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery(); //ApplicableRegionSet set = query.getApplicableRegions(loc); @@ -72,7 +64,7 @@ public class WorldGuardManager { com.sk89q.worldedit.util.Location loc = localPlayer.getLocation(); //WorldGuardPlugin worldGuard = getWorldGuard(); - RegionQuery query = container.createQuery(); + RegionQuery query = WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery(); //ApplicableRegionSet set = query.getApplicableRegions(loc); @@ -93,10 +85,8 @@ public class WorldGuardManager { public void registerFlags() { - if(getWorldGuard() == null) - return; - FlagRegistry registry = WorldGuard.getInstance().getFlagRegistry(); + try { // register our flag with the registry registry.register(WorldGuardFlags.MCMMO_ENABLE_WG_FLAG); diff --git a/src/main/java/com/gmail/nossr50/worldguard/WorldGuardUtils.java b/src/main/java/com/gmail/nossr50/worldguard/WorldGuardUtils.java index 8841ca69f..505dfd622 100644 --- a/src/main/java/com/gmail/nossr50/worldguard/WorldGuardUtils.java +++ b/src/main/java/com/gmail/nossr50/worldguard/WorldGuardUtils.java @@ -43,7 +43,7 @@ public class WorldGuardUtils { if(detectedIncompatibleWG) return false; - WorldGuardPlugin worldGuardPlugin = getWorldGuard(); + worldGuardPluginRef = getWorldGuard(); return isLoaded; } @@ -104,12 +104,12 @@ public class WorldGuardUtils { } catch (ClassNotFoundException e) { mcMMO.p.getLogger().severe("Missing WorldGuard class - "+classString); markWGIncompatible(); - break; //Break out of the loop + return false; } } } - return detectedIncompatibleWG; + return true; } /** From e71c95139d5987c5dba8c807c5d3f883f05a5999 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Mon, 24 Jun 2019 23:31:31 -0700 Subject: [PATCH 20/26] RetroMode is now the default mode. --- Changelog.txt | 7 +++++++ .../gmail/nossr50/skills/acrobatics/AcrobaticsManager.java | 2 +- src/main/resources/config.yml | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index f7e66f702..91b4c4b8e 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -2,6 +2,7 @@ Version 2.1.89 Many changes were made to this version that affect default values in the config, read the notes carefully if you wish to apply these changes. They are optional. mcMMO is compatible with the new 1.14.3, in addition to this it is still compatible with 1.14.2, 1.14.1, 1.14, and 1.13.2. This did not require any changes to be made to mcMMO, but I thought I'd add this to the notes for those wondering. + RetroMode is the default level scaling mode again The default level for players has been changed back to 0 from 1 (you can change it back to 1 by editing 'Skills.General.StartingLevel' in advanced.yml) if you wish to apply this change read the notes Super Abilities now scale in length up to level 100/1000 instead of 50/500 by default (you can edit this in advanced.yml under 'Skills.General.Ability.Length.xxx') Early Game Boost now only applies when leveling from level 0 to level 1 @@ -11,6 +12,7 @@ Version 2.1.89 Added locale string 'Excavation.SubSkill.Archaeology.Stat' Added locale string 'Excavation.SubSkill.Archaeology.Stat.Extra' Tweaked the locale string 'Fishing.SubSkill.MasterAngler.Stat' + The interval at which you can gain Acrobatics XP from fall damage has been reduced to 3 seconds from 10 seconds, this will be configurable in 2.2. When using WorldGuard (WG) with mcMMO, mcMMO now examines WG more carefully to determine if it is a compatible version or not, see the notes. Keep in mind WG is optional and not needed to run mcMMO. Fixed a bug that could result in Tree Feller failing to remove parts of a tree in snowy biomes. (This fix won't apply retroactively to old trees, see the notes) @@ -64,6 +66,11 @@ Version 2.1.89 Tree Feller will now give reduced XP per block destroyed by Tree Feller and will never go below 1 XP per block, you can turn this off with 'ExploitFix.TreeFellerReducedXP' in experience.yml There was a bug fixed in this patch that prevents an issue where Tree Feller was not removing all blocks left behind, unfortunately this will only affect new trees made in the world. The only trees that suffered from this bug were ones in snowy areas that had snow form on them. + RetroMode and Standard mode will be getting renamed in 2.2, probably to something like 1000-scale and 100-scale respectively. + Retro Mode was accidental genius is the short reason for the change to make it the default level scaling for mcMMO again. + Standard Mode is not going anywhere, it is just opt-in now instead of the default. + If you delete config.yml you will need to turn RetroMode off to use Standard mode as mcMMO doesn't keep track of what level scaling you are using outside of that. + Version 2.1.88 mcMMO is now more compatible with a plugin named Project Korra mcMMO will no longer process combat triggers for damage at or below 0 diff --git a/src/main/java/com/gmail/nossr50/skills/acrobatics/AcrobaticsManager.java b/src/main/java/com/gmail/nossr50/skills/acrobatics/AcrobaticsManager.java index fc45b061f..1ff6fa3b2 100644 --- a/src/main/java/com/gmail/nossr50/skills/acrobatics/AcrobaticsManager.java +++ b/src/main/java/com/gmail/nossr50/skills/acrobatics/AcrobaticsManager.java @@ -29,7 +29,7 @@ public class AcrobaticsManager extends SkillManager { } private long rollXPCooldown = 0; - private long rollXPInterval = (1000 * 10); //1 Minute + private long rollXPInterval = (1000 * 3); //1 Minute private long rollXPIntervalLengthen = (1000 * 10); //10 Seconds private LimitedSizeList fallLocationMap; diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 7f7b9cf5c..90140e40a 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -12,7 +12,7 @@ General: # Everything in your config related to skill level requirements, skill level bonuses, etc will be multiplied by 10 when this mode is on # This change is purely cosmetic, it retains the old feel of mcMMO where you could level up thousands of times RetroMode: - Enabled: false + Enabled: true Locale: en_US AprilFoolsEvent: true MOTD_Enabled: true From 03efd14ff4671edba1976e7c843d5c04e0cf2f7d Mon Sep 17 00:00:00 2001 From: nossr50 Date: Mon, 24 Jun 2019 23:33:17 -0700 Subject: [PATCH 21/26] 2.1.89 --- Changelog.txt | 2 ++ pom.xml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Changelog.txt b/Changelog.txt index 91b4c4b8e..7c7c2569a 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -41,6 +41,8 @@ Version 2.1.89 Berserk now unlocks at levels 5/50 instead of 10/100 NOTES: + I'm looking into adding 1.12.2 support sooner than expected. + Editing your config files is not required for this patch (and never will be), however I would highly recommend it. Read the notes below this line carefully. If you want to update to this patch easily and you don't mind default config values, delete skillranks.yml, advanced.yml, and experience.yml before starting your server with 2.1.89 of mcMMO applied. Many skills now unlock at level 1 and the default starting level is back to 0. It is recommended you change this number from 1 to 0 manually by editing 'Skills.General.StartingLevel' in advanced.yml or deleting advanced.yml and generating a new file when 2.1.89 starts. diff --git a/pom.xml b/pom.xml index 866f23df0..ca4960d21 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.89-SNAPSHOT + 2.1.89 mcMMO https://github.com/mcMMO-Dev/mcMMO From 74a2485cffc987c75ba41b24eeee28e8317445d5 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 25 Jun 2019 18:02:16 -0700 Subject: [PATCH 22/26] Multiple tweaks to how salvaged items travel towards a player --- Changelog.txt | 11 +++++ pom.xml | 2 +- .../skills/salvage/SalvageManager.java | 20 ++++++--- .../java/com/gmail/nossr50/util/Misc.java | 44 +++++++++++++------ src/main/resources/experience.yml | 4 +- 5 files changed, 60 insertions(+), 21 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 7c7c2569a..67ca1df1a 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,3 +1,14 @@ +Version 2.1.90 + Default values for Packed Ice and Blue Ice reduced to 20 XP (update manually or delete experience.yml to regen your config) + Salvaged items now travel much slower towards the player + Books from salvage will now travel towards the player + Salvaged items travelling towards you will now have their speed adjusted based on distance + + NOTES: + Sorry about salvaged items traveling too quickly, in testing on my LAN server with ideal conditions they always entered my inventory and never shot past me so the high speed of the items was not an apparent issue. + However, conditions are not always ideal so having the item travel at you quickly can lead to problems, and I've gotten reports about the items shooting past players. This was not intentional and something that did not happen during testing, but was a valid bug. + I've made it so now items spawned from salvage can only travel very slowly towards you, this solves the original issue where salvaged items were being flung in random directions (how its been in mcMMO for like 6 years) without potential for accidents. + Version 2.1.89 Many changes were made to this version that affect default values in the config, read the notes carefully if you wish to apply these changes. They are optional. mcMMO is compatible with the new 1.14.3, in addition to this it is still compatible with 1.14.2, 1.14.1, 1.14, and 1.13.2. This did not require any changes to be made to mcMMO, but I thought I'd add this to the notes for those wondering. diff --git a/pom.xml b/pom.xml index ca4960d21..aebe9be8e 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.89 + 2.1.90-SNAPSHOT mcMMO https://github.com/mcMMO-Dev/mcMMO diff --git a/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java b/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java index bc7a80983..de0e0f74b 100644 --- a/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java +++ b/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java @@ -140,18 +140,28 @@ public class SalvageManager extends SkillManager { return; } + Location anvilLoc = location.clone(); + Location playerLoc = player.getLocation().clone(); + double distance = anvilLoc.distance(playerLoc); + + double speedLimit = .6; + double minSpeed = .3; + + //Clamp the speed and vary it by distance + double vectorSpeed = Math.min(speedLimit, Math.max(minSpeed, distance * .2)); + + //Add a very small amount of height + anvilLoc.add(0, .1, 0); + if (enchantBook != null) { - Misc.dropItem(location, enchantBook); + Misc.spawnItemTowardsLocation(anvilLoc.clone(), playerLoc.clone(), enchantBook, vectorSpeed); } - Misc.spawnItemTowardsLocation(location, player.getLocation().add(0, 0.25, 0), salvageResults); + Misc.spawnItemTowardsLocation(anvilLoc.clone(), playerLoc.clone(), salvageResults, vectorSpeed); // BWONG BWONG BWONG - CLUNK! if (Config.getInstance().getSalvageAnvilUseSoundsEnabled()) { -// SoundManager.sendSound(player, player.getLocation(), SoundType.ANVIL); SoundManager.sendSound(player, player.getLocation(), SoundType.ITEM_BREAK); - - //player.playSound(player.getLocation(), Sound.ENTITY_ITEM_BREAK, 1.0F, 1.0F); } NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE, "Salvage.Skills.Success"); diff --git a/src/main/java/com/gmail/nossr50/util/Misc.java b/src/main/java/com/gmail/nossr50/util/Misc.java index 99dbf057d..ff892d659 100644 --- a/src/main/java/com/gmail/nossr50/util/Misc.java +++ b/src/main/java/com/gmail/nossr50/util/Misc.java @@ -121,40 +121,58 @@ public final class Misc { /** * Drop items at a given location. * - * @param location The location to drop the items at + * @param fromLocation The location to drop the items at * @param is The items to drop + * @param speed the speed that the item should travel * @param quantity The amount of items to drop */ - public static void spawnItemsTowardsLocation(Location location, Location targetLocation, ItemStack is, int quantity) { + public static void spawnItemsTowardsLocation(Location fromLocation, Location toLocation, ItemStack is, int quantity, double speed) { for (int i = 0; i < quantity; i++) { - spawnItemTowardsLocation(location, targetLocation, is); + spawnItemTowardsLocation(fromLocation, toLocation, is, speed); } } /** * Drop an item at a given location. + * This method is fairly expensive as it creates clones of everything passed to itself since they are mutable objects * - * @param spawnLocation The location to drop the item at - * @param itemStack The item to drop + * @param fromLocation The location to drop the item at + * @param toLocation The location the item will travel towards + * @param itemToSpawn The item to spawn + * @param speed the speed that the item should travel * @return Dropped Item entity or null if invalid or cancelled */ - public static Item spawnItemTowardsLocation(Location spawnLocation, Location targetLocation, ItemStack itemStack) { - if (itemStack.getType() == Material.AIR) { + public static Item spawnItemTowardsLocation(Location fromLocation, Location toLocation, ItemStack itemToSpawn, double speed) { + if (itemToSpawn.getType() == Material.AIR) { return null; } + //Work with fresh copies of everything + ItemStack clonedItem = itemToSpawn.clone(); + Location spawnLocation = fromLocation.clone(); + Location targetLocation = toLocation.clone(); + // We can't get the item until we spawn it and we want to make it cancellable, so we have a custom event. - McMMOItemSpawnEvent event = new McMMOItemSpawnEvent(spawnLocation, itemStack); + McMMOItemSpawnEvent event = new McMMOItemSpawnEvent(spawnLocation, clonedItem); mcMMO.p.getServer().getPluginManager().callEvent(event); - if (event.isCancelled()) { + //Something cancelled the event so back out + if (event.isCancelled() || event.getItemStack() == null) { return null; } - Item item = spawnLocation.getWorld().dropItem(spawnLocation, itemStack); - Vector vector = targetLocation.toVector().subtract(spawnLocation.toVector()).normalize(); - item.setVelocity(vector); - return item; + //Use the item from the event + Item spawnedItem = spawnLocation.getWorld().dropItem(spawnLocation, clonedItem); + Vector vecFrom = spawnLocation.clone().toVector().clone(); + Vector vecTo = targetLocation.clone().toVector().clone(); + + //Vector which is pointing towards out target location + Vector direction = vecTo.subtract(vecFrom).normalize(); + + //Modify the speed of the vector + direction = direction.multiply(speed); + spawnedItem.setVelocity(direction); + return spawnedItem; } public static void profileCleanup(String playerName) { diff --git a/src/main/resources/experience.yml b/src/main/resources/experience.yml index 585066949..2da86f197 100644 --- a/src/main/resources/experience.yml +++ b/src/main/resources/experience.yml @@ -368,8 +368,8 @@ Experience_Values: Mossy_Cobblestone: 30 Netherrack: 30 Obsidian: 150 - Packed_Ice: 50 - Blue_Ice: 100 + Packed_Ice: 20 + Blue_Ice: 20 Nether_Quartz_Ore: 100 Redstone_Ore: 150 Sandstone: 30 From 2eb330f0708f1b2ac69ad0a03b6a6869651f766f Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 25 Jun 2019 18:20:56 -0700 Subject: [PATCH 23/26] Mining XP values tweaked --- Changelog.txt | 29 +++++++++++++++++++++++--- src/main/resources/experience.yml | 34 +++++++++++++++---------------- 2 files changed, 43 insertions(+), 20 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 67ca1df1a..6e84b8b61 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,13 +1,36 @@ Version 2.1.90 - Default values for Packed Ice and Blue Ice reduced to 20 XP (update manually or delete experience.yml to regen your config) Salvaged items now travel much slower towards the player Books from salvage will now travel towards the player Salvaged items travelling towards you will now have their speed adjusted based on distance + Common Materials found when mining have had their XP gains reduced and rare materials have had their XP gains increased + Diamond Ore has had its XP increased from 750 to 2400 + Gold Ore has had its XP increased from 350 to 1300 + Iron Ore has had its XP increased from 250 to 900 + Lapis Ore has had its XP increased from 400 to 800 + Nether Quartz Ore has had its XP increased from 100 to 300 + Redstone Ore has had its XP increased from 150 to 600 + Blue_Ice has had its default XP value reduced to 15 + Packed_Ice has had its default XP value reduced to 15 + Netherrack has had its default XP value reduced to 15 + Coal Ore has had its XP increased from 100 to 400 + Stone has had its XP decreased from 30 to 15 + Granite has had its XP decreased from 30 to 15 + Andesite has had its XP decreased from 30 to 15 + Diorite has had its XP decreased from 30 to 15 + End Stone has had its XP decreased from 30 to 15 + Glow Stone has had its XP decreased from 30 to 15 + End Bricks has had its XP decreased from 200 to 50 + + NOTES: + You can either apply the default XP changes manually to experience.yml or delete it to generate a new file + Sorry about salvaged items traveling too quickly, in testing on my LAN server with ideal conditions they always entered my inventory and never shot past me so the high speed of the items was not an apparent issue. - However, conditions are not always ideal so having the item travel at you quickly can lead to problems, and I've gotten reports about the items shooting past players. This was not intentional and something that did not happen during testing, but was a valid bug. - I've made it so now items spawned from salvage can only travel very slowly towards you, this solves the original issue where salvaged items were being flung in random directions (how its been in mcMMO for like 6 years) without potential for accidents. + I've tested the new changes to how they travel towards you pretty thoroughly, they never go fast enough to go past you and they adjust their speed based on distance to you with some speed limitations. + In testing the new tweaks work well whether the salvage anvil is above, below, or at the same height as you. + + I'll be tweaking XP values across all skills more carefully in the upcoming content patch due after 2.2. Some tweaks to XP gains will be applied for 2.2. Version 2.1.89 Many changes were made to this version that affect default values in the config, read the notes carefully if you wish to apply these changes. They are optional. diff --git a/src/main/resources/experience.yml b/src/main/resources/experience.yml index 2da86f197..faeb5a6c3 100644 --- a/src/main/resources/experience.yml +++ b/src/main/resources/experience.yml @@ -354,24 +354,24 @@ Experience_Values: Bubble_Coral_Block: 70 Fire_Coral_Block: 90 Horn_Coral_Block: 125 - Coal_Ore: 100 - Diamond_Ore: 750 + Coal_Ore: 400 + Diamond_Ore: 2400 Emerald_Ore: 1000 - End_Bricks: 200 + End_Bricks: 50 Nether_Brick: 50 - End_Stone: 30 - Glowstone: 30 - Gold_Ore: 350 + End_Stone: 15 + Glowstone: 15 + Gold_Ore: 1300 Terracotta: 30 - Iron_Ore: 250 - Lapis_Ore: 400 + Iron_Ore: 900 + Lapis_Ore: 800 Mossy_Cobblestone: 30 - Netherrack: 30 + Netherrack: 15 Obsidian: 150 - Packed_Ice: 20 - Blue_Ice: 20 - Nether_Quartz_Ore: 100 - Redstone_Ore: 150 + Packed_Ice: 15 + Blue_Ice: 15 + Nether_Quartz_Ore: 300 + Redstone_Ore: 600 Sandstone: 30 Black_Terracotta: 50 Blue_Terracotta: 50 @@ -389,10 +389,10 @@ Experience_Values: Red_Terracotta: 50 White_Terracotta: 50 Yellow_Terracotta: 50 - Stone: 30 - Granite: 30 - Andesite: 30 - Diorite: 30 + Stone: 15 + Granite: 15 + Andesite: 15 + Diorite: 15 Stone_Bricks: 50 Cracked_Stone_Bricks: 50 Mossy_Stone_Bricks: 50 From 3368625dde13b16176a9c710f6699ee8448b4031 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 25 Jun 2019 18:21:14 -0700 Subject: [PATCH 24/26] 2.1.90 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index aebe9be8e..c70b6f841 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.90-SNAPSHOT + 2.1.90 mcMMO https://github.com/mcMMO-Dev/mcMMO From 517ca6568f7407525884c4ee3dd0604f32c87730 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 25 Jun 2019 22:29:02 -0700 Subject: [PATCH 25/26] Increase compatiblility with crazy enchants --- Changelog.txt | 3 +++ pom.xml | 2 +- .../java/com/gmail/nossr50/listeners/EntityListener.java | 1 - .../com/gmail/nossr50/skills/archery/ArcheryManager.java | 4 ++++ .../java/com/gmail/nossr50/util/skills/CombatUtils.java | 6 +++++- 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 6e84b8b61..ca8f771cf 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,3 +1,6 @@ +Version 2.1.91 + mcMMO is now more compatible with plugins that spawn arrows in unexpected ways, this fixes some NPE in mcMMO when using certain plugins + Version 2.1.90 Salvaged items now travel much slower towards the player Books from salvage will now travel towards the player diff --git a/pom.xml b/pom.xml index c70b6f841..b2d5d1425 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.90 + 2.1.91-SNAPSHOT mcMMO https://github.com/mcMMO-Dev/mcMMO diff --git a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java index 87f5dac56..2e2376584 100644 --- a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java @@ -128,7 +128,6 @@ public class EntityListener implements Listener { if(event.getEntity().getShooter() instanceof Player) { - Player player = (Player) event.getEntity().getShooter(); /* WORLD GUARD MAIN FLAG CHECK */ diff --git a/src/main/java/com/gmail/nossr50/skills/archery/ArcheryManager.java b/src/main/java/com/gmail/nossr50/skills/archery/ArcheryManager.java index 3fd7537df..91f9f9588 100644 --- a/src/main/java/com/gmail/nossr50/skills/archery/ArcheryManager.java +++ b/src/main/java/com/gmail/nossr50/skills/archery/ArcheryManager.java @@ -53,6 +53,10 @@ public class ArcheryManager extends SkillManager { * @param damager The {@link Entity} who shot the arrow */ public double distanceXpBonusMultiplier(LivingEntity target, Entity damager) { + //Hacky Fix - some plugins spawn arrows and assign them to players after the ProjectileLaunchEvent fires + if(!damager.hasMetadata(mcMMO.arrowDistanceKey)) + return damager.getLocation().distance(target.getLocation()); + Location firedLocation = (Location) damager.getMetadata(mcMMO.arrowDistanceKey).get(0).value(); Location targetLocation = target.getLocation(); diff --git a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java index 35a5ab83b..5b5aecb04 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java @@ -232,9 +232,13 @@ public final class CombatUtils { } double distanceMultiplier = archeryManager.distanceXpBonusMultiplier(target, arrow); + double forceMultiplier = 1.0; //Hacky Fix - some plugins spawn arrows and assign them to players after the ProjectileLaunchEvent fires + + if(arrow.hasMetadata(mcMMO.bowForceKey)) + forceMultiplier = arrow.getMetadata(mcMMO.bowForceKey).get(0).asDouble(); applyScaledModifiers(initialDamage, finalDamage, event); - startGainXp(mcMMOPlayer, target, PrimarySkillType.ARCHERY, arrow.getMetadata(mcMMO.bowForceKey).get(0).asDouble() * distanceMultiplier); + startGainXp(mcMMOPlayer, target, PrimarySkillType.ARCHERY, forceMultiplier * distanceMultiplier); } /** From 9092e705445db25c7efa0f97684d11902d855143 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 25 Jun 2019 22:44:14 -0700 Subject: [PATCH 26/26] Check the projectile type instead of main hand item --- .../java/com/gmail/nossr50/listeners/EntityListener.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java index 2e2376584..69ca40c52 100644 --- a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java @@ -139,11 +139,7 @@ public class EntityListener implements Listener { Projectile projectile = event.getEntity(); - //Hacky stuff for 1.13/1.14 compat - - String itemKey = player.getInventory().getItemInMainHand().getType().getKey().toString(); - - if(!itemKey.equalsIgnoreCase("minecraft:bow") && !itemKey.equalsIgnoreCase("minecraft:crossbow")) + if(!(projectile instanceof Arrow)) return; projectile.setMetadata(mcMMO.bowForceKey, new FixedMetadataValue(plugin, 1.0));