Better Help Command Visibility
This commit is contained in:
parent
3f262e13bc
commit
8b88dbe15b
@ -68,12 +68,15 @@ public class MassiveCommandHelp extends MassiveCommand
|
||||
boolean visible = super.isVisibleTo(sender);
|
||||
if ( ! (this.hasParent() && visible)) return visible;
|
||||
|
||||
int visibleSiblingCount = 0;
|
||||
for (MassiveCommand sibling : this.getParent().getChildren())
|
||||
{
|
||||
if (sibling == this) continue;
|
||||
if (sibling.isVisibleTo(sender)) visibleSiblingCount++;
|
||||
}
|
||||
|
||||
int pageHeight = (sender instanceof Player) ? Txt.PAGEHEIGHT_PLAYER : Txt.PAGEHEIGHT_CONSOLE;
|
||||
|
||||
// Minues one, don't count ourself.
|
||||
int size = this.getParent().getChildren().size()-1;
|
||||
|
||||
if (size <= pageHeight)
|
||||
if (visibleSiblingCount <= pageHeight)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user