Replace getName with hasPlayedBefore as offlineplayer will never be null. This fixes quite a few command bugs.

This commit is contained in:
CoOwner/Developer for @ArkhamNetwork - Java, PHP, Redis, LAMP 2014-05-16 17:48:59 +01:00
parent 51ac5d2cb2
commit 1a9a2f65c0

View File

@ -132,7 +132,7 @@ public abstract class FCommand extends MCommand<P> {
if (name != null) {
OfflinePlayer player = Bukkit.getOfflinePlayer(name);
if (player.getName() != null) {
if (player.hasPlayedBefore()) {
FPlayer fplayer = FPlayers.i.get(player);
if (fplayer != null) {
ret = fplayer;
@ -196,7 +196,7 @@ public abstract class FCommand extends MCommand<P> {
// Next we match player names
if (faction == null) {
OfflinePlayer player = Bukkit.getOfflinePlayer(name);
if (player.getName() != null) {
if (player.hasPlayedBefore()) {
FPlayer fplayer = FPlayers.i.get(player);
if (fplayer != null) {
faction = fplayer.getFaction();