mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-30 00:56:47 +01:00
In Kraken command, use getPlayer(name, true) and a null-check
This commit is contained in:
parent
92fa2782d0
commit
2fcd3904dc
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user