Minor changes in CompositeCommand

Notably improved the #isPlayer(user) condition
This commit is contained in:
Florian CUNY 2018-01-03 21:15:01 +01:00
parent b8dcc98a0c
commit 7acc8d5401

View File

@ -304,7 +304,6 @@ public abstract class CompositeCommand extends Command implements PluginIdentifi
this.usage = parent.getLabel() + " " + this.usage;
parent = parent.getParent();
}
this.usage = this.usage;
this.usage = this.usage.trim();
return this;
}
@ -358,10 +357,9 @@ public abstract class CompositeCommand extends Command implements PluginIdentifi
* @return true if sender is a player
*/
protected boolean isPlayer(User user) {
return (user.getPlayer() instanceof Player);
return user.getPlayer() != null;
}
/**
* Set whether this command is only for players
* @param onlyPlayer