Added isVisibleTo
This commit is contained in:
parent
9c2838efc5
commit
8bce24bb61
@ -186,8 +186,6 @@ public abstract class MCommand
|
|||||||
|
|
||||||
if ( ! validCall(this.sender, this.args)) return;
|
if ( ! validCall(this.sender, this.args)) return;
|
||||||
|
|
||||||
if ( ! this.isEnabled()) return;
|
|
||||||
|
|
||||||
perform();
|
perform();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -222,9 +220,11 @@ public abstract class MCommand
|
|||||||
return true;
|
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)
|
public boolean requirementsAreMet(CommandSender sender, boolean informSenderIfNot)
|
||||||
|
Loading…
Reference in New Issue
Block a user