From 287842c675d06fdaf94d91ec68900ef63001a220 Mon Sep 17 00:00:00 2001 From: TfT_02 Date: Wed, 27 Mar 2013 20:17:49 +0100 Subject: [PATCH] Fixed bug which causes a NPE when trying to use /mcrefresh from the console --- Changelog.txt | 3 ++- src/main/java/com/gmail/nossr50/commands/McrefreshCommand.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 2f3383be0..7d717ee63 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -18,7 +18,8 @@ Version 1.4.04-dev = Fixed bug where Shake wouldn't damage mobs whose max health was less than 4 = Fixed bug where the API would fail if the name of a player's current party is requested when the player isn't in one (Thanks @dualspiral!) = Fixed bug with retrieving a player's party members - = Fixed bug which caused an NPE when trying to join the party of a non-existing player or when ptp to a non-existing player + = Fixed bug which caused a NPE when trying to join the party of a non-existing player or when ptp to a non-existing player + = Fixed bug which causes a NPE when trying to use /mcrefresh from the console ! Changed config node name for the skill experience modifiers from "Experience.Formula.Multiplier.[Skill]" to "Experience.Formula.Modifier.[Skill]" ! Updated localization files ! mcMMO abilities can no longer be activated while in Creative mode diff --git a/src/main/java/com/gmail/nossr50/commands/McrefreshCommand.java b/src/main/java/com/gmail/nossr50/commands/McrefreshCommand.java index 7e86e8d06..af59d6887 100644 --- a/src/main/java/com/gmail/nossr50/commands/McrefreshCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/McrefreshCommand.java @@ -53,7 +53,7 @@ public class McrefreshCommand implements CommandExecutor { } refreshPlayer(); - sender.sendMessage(LocaleLoader.getString("Commands.mcrefresh.Success", args[0])); + sender.sendMessage(LocaleLoader.getString("Commands.mcrefresh.Success", player.getName())); return true; default: @@ -67,6 +67,7 @@ public class McrefreshCommand implements CommandExecutor { mcMMOPlayer.resetToolPrepMode(); mcMMOPlayer.resetAbilityMode(); + player = mcMMOPlayer.getPlayer(); player.sendMessage(LocaleLoader.getString("Ability.Generic.Refresh")); } }