From a21b4585c5977bdfc63ba3286566ffcef09de0c0 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sat, 12 Jan 2019 22:14:23 -0800 Subject: [PATCH] Classic Scaling is now Retro Mode to avoid confusion --- Changelog.txt | 5 +++-- .../skills/{MmoInfo.java => MmoInfoCommand.java} | 5 ++++- src/main/java/com/gmail/nossr50/config/Config.java | 6 +++--- .../gmail/nossr50/datatypes/player/McMMOPlayer.java | 4 ++++ .../util/commands/CommandRegistrationManager.java | 2 +- src/main/resources/config.yml | 10 +++++----- src/main/resources/skillranks.yml | 0 7 files changed, 20 insertions(+), 12 deletions(-) rename src/main/java/com/gmail/nossr50/commands/skills/{MmoInfo.java => MmoInfoCommand.java} (96%) create mode 100644 src/main/resources/skillranks.yml diff --git a/Changelog.txt b/Changelog.txt index de69776d3..ae5f745ff 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -10,7 +10,7 @@ Key: Version 2.1.0 + Prevented exploits involving blocks made from entities (snowmen, etc..) + Added JSON integration to all Skill Commands - + Added config setting to enable or disable old mcMMO skill scaling (General.UseOldLevelScaling) this is on by default for existing installs + + Added config setting to enable or disable old mcMMO skill scaling (General.RetroMode) this is on by default for existing installs + You can now disable specific skills in coreskills.yml without the need for permissions + Added links to mcMMO related websites to various commands + Certain elements of mcMMO's UI have been restyled @@ -20,12 +20,13 @@ Version 2.1.0 + (Skills) Tool alerts now are sent to the Action Bar + (Skills) Super Ability activation alerts are now sent to the Action Bar + (Skills) Certain Skill messages are now sent to the Action Bar + + (Config) Skill Ranks are now defined in skillranks.yml if a skill does not have a rank it's unlocked right away + (Config) Added option to use SSL for MySQL in config.yml + (Config) Added option to disable the new URL links to config.yml + (Config) New config file added coreskills.yml + (Config) Added rank settings for the new Woodcutting skill + (Config) Added configurable parameters for the new Tree Feller - + (Config) Added classic toggle for Tree Feller + + (Config) Added retro toggle for Tree Feller + (Config) Added toggle to disable all scoreboards + (Chat) Added ability for admins to spy on party chat (off unless toggled on) + (Commands) Added new info command /mmoinfo or /mcinfo diff --git a/src/main/java/com/gmail/nossr50/commands/skills/MmoInfo.java b/src/main/java/com/gmail/nossr50/commands/skills/MmoInfoCommand.java similarity index 96% rename from src/main/java/com/gmail/nossr50/commands/skills/MmoInfo.java rename to src/main/java/com/gmail/nossr50/commands/skills/MmoInfoCommand.java index 4403f6e3f..b26c8b070 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/MmoInfo.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/MmoInfoCommand.java @@ -19,12 +19,15 @@ import java.util.List; /** * This is the command that retrieves data about skills from in-game sources */ -public class MmoInfo implements TabExecutor { +public class MmoInfoCommand implements TabExecutor { @Override public boolean onCommand(CommandSender commandSender, Command command, String s, String[] args) { if(commandSender instanceof Player) { + if(args.length < 1) + return false; + Player player = (Player) commandSender; if(Permissions.mmoinfo(player)) { diff --git a/src/main/java/com/gmail/nossr50/config/Config.java b/src/main/java/com/gmail/nossr50/config/Config.java index cdc788173..197ca0df0 100644 --- a/src/main/java/com/gmail/nossr50/config/Config.java +++ b/src/main/java/com/gmail/nossr50/config/Config.java @@ -246,13 +246,13 @@ public class Config extends AutoUpdateConfigLoader { /* General Settings */ //Classic mode will default the value to true if the config file doesn't contain the entry (server is from a previous mcMMO install) - public boolean getUseOldLevelScaling() { return config.getBoolean("General.UseOldLevelScaling", true); } + public boolean getUseOldLevelScaling() { return config.getBoolean("General.RetroMode", true); } //XP needed to level is multiplied by this when using classic mode - public int getClassicModeXPFormulaFactor() { return config.getInt("General.Skill_Scaling.Classic_XP_Formula_Factor", 1); } + public int getClassicModeXPFormulaFactor() { return config.getInt("General.Skill_Scaling.RetroMode_XP_Formula_Factor", 1); } //Level requirements for subskills is multiplied by this when using classic mode - public int getClassicModeLevelReqFactor() { return config.getInt("General.Skill_Scaling.Classic_LevelReq_Factor", 10); } + public int getClassicModeLevelReqFactor() { return config.getInt("General.Skill_Scaling.RetroMode_LevelReq_Factor", 10); } public String getLocale() { return config.getString("General.Locale", "en_us"); } public boolean getMOTDEnabled() { return config.getBoolean("General.MOTD_Enabled", true); } 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 2ad945c44..001969d73 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java +++ b/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java @@ -516,6 +516,10 @@ public class McMMOPlayer { SoundManager.sendSound(player, player.getLocation(), SoundType.LEVEL_UP); } + /* + * Check to see if the player unlocked any new skills + */ + NotificationManager.sendPlayerLevelUpNotification(UserManager.getPlayer(player), primarySkill, profile.getSkillLevel(primarySkill)); } diff --git a/src/main/java/com/gmail/nossr50/util/commands/CommandRegistrationManager.java b/src/main/java/com/gmail/nossr50/util/commands/CommandRegistrationManager.java index 49aac2064..941ea246c 100644 --- a/src/main/java/com/gmail/nossr50/util/commands/CommandRegistrationManager.java +++ b/src/main/java/com/gmail/nossr50/util/commands/CommandRegistrationManager.java @@ -162,7 +162,7 @@ public final class CommandRegistrationManager { command.setPermission("mcmmo.commands.mmoinfo"); command.setPermissionMessage(permissionsMessage); command.setUsage(LocaleLoader.getString("Commands.Usage.1", "mmoinfo", "[" + LocaleLoader.getString("Commands.Usage.SubSkill") + "]")); - command.setExecutor(new MmoInfo()); + command.setExecutor(new MmoInfoCommand()); } private static void registerMcChatSpyCommand() { diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 6440a8ab9..169304803 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -12,13 +12,13 @@ General: # Turning this on will scale mcMMO around 1-1000 with default scaling factor # 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 - UseOldLevelScaling: true + RetroMode: true Skill_Scaling: - # This is the value that is skill level requirements are multiplied by in Classic Mode (Default is 10) - Classic_LevelReq_Factor: 10 - # This is the value that the xp required to level is multiplied by when in classic mode + # This is the value that is skill level requirements are multiplied by in Retro Mode (Default is 10) + RetroMode_LevelReq_Factor: 10 + # This is the value that the xp required to level is multiplied by when in Retro mode # Default is 1 - Classic_XP_Formula_Factor: 1 + RetroMode_XP_Formula_Factor: 1 Locale: en_US MOTD_Enabled: true # Send a message to the player when his profile was successfully loaded diff --git a/src/main/resources/skillranks.yml b/src/main/resources/skillranks.yml new file mode 100644 index 000000000..e69de29bb