In Kraken command, use getPlayer(name, true) and a null-check

This commit is contained in:
riking 2013-10-28 13:20:26 -07:00
parent 92fa2782d0
commit 2fcd3904dc

View File

@ -11,11 +11,10 @@ import org.bukkit.entity.Player;
import org.bukkit.util.StringUtil; import org.bukkit.util.StringUtil;
import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.commands.CommandUtils; import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.util.player.UserManager;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
public class KrakenCommand implements TabExecutor { public class KrakenCommand implements TabExecutor {
@ -41,10 +40,10 @@ public class KrakenCommand implements TabExecutor {
return true; return true;
} }
String playerName = Misc.getMatchedPlayerName(args[0]); McMMOPlayer mcMMOPlayer = UserManager.getPlayer(args[0], true);
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(playerName);
if (!CommandUtils.checkPlayerExistence(sender, playerName, mcMMOPlayer)) { if (mcMMOPlayer == null) {
sender.sendMessage(LocaleLoader.getString("Commands.Offline"));
return true; return true;
} }