empty message shouldnt show prefix by default.

This commit is contained in:
benwoo1110 2021-01-03 23:49:12 +08:00
parent 0f23deeca1
commit cde7ab961f
2 changed files with 5 additions and 14 deletions

View File

@ -19,17 +19,6 @@ public abstract class ShowInline<C extends InlineDisplay<?, T>, T> extends ShowR
this.contentBuilder = new StringBuilder();
}
@Override
protected void display() {
showHeader();
if (!hasContentToShow()) {
this.display.getSender().sendMessage(String.format("%s%s",
this.display.getPrefix(), this.display.getEmptyMessage()));
return;
}
showContent();
}
/**
* {@inheritDoc}
*/

View File

@ -57,8 +57,7 @@ public class WhoCommand extends MultiverseCommand {
}
ListDisplay display = new ListDisplay().withSender(sender)
.withFilter(filter)
.withEmptyMessage(String.format("%sNo players found.", ChatColor.GRAY));
.withFilter(filter);
this.plugin.getMVWorldManager().getMVWorlds().stream()
.filter(world -> player == null || this.plugin.getMVPerms().canEnterWorld(player, world))
@ -69,8 +68,11 @@ public class WhoCommand extends MultiverseCommand {
@NotNull ListDisplay display,
@NotNull Set<Player> visiblePlayers) {
String prefix = String.format("%s%s - ", world.getColoredWorldString(), ChatColor.WHITE);
display.withCreator(buildPlayerList(world, visiblePlayers))
.withPrefix(String.format("%s%s - ", world.getColoredWorldString(), ChatColor.WHITE))
.withPrefix(prefix)
.withEmptyMessage(String.format("%s%sNo players found.", prefix, ChatColor.GRAY))
.build()
.run();
}