Added isVisibleTo

This commit is contained in:
Olof Larsson 2011-12-12 19:26:00 +01:00
parent 9c2838efc5
commit 8bce24bb61

View File

@ -186,8 +186,6 @@ public abstract class MCommand
if ( ! validCall(this.sender, this.args)) return;
if ( ! this.isEnabled()) return;
perform();
}
@ -222,9 +220,11 @@ public abstract class MCommand
return true;
}
public boolean isEnabled()
public boolean visibleTo(CommandSender sender)
{
return true;
if (this.getVisibilityMode() == VisibilityMode.VISIBLE) return true;
if (this.getVisibilityMode() == VisibilityMode.INVISIBLE) return false;
return this.requirementsAreMet(sender, false);
}
public boolean requirementsAreMet(CommandSender sender, boolean informSenderIfNot)