mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2025-02-04 22:51:22 +01:00
Fixes for hidden worlds displaying as null
This commit is contained in:
parent
750adcf376
commit
86af11b662
@ -200,6 +200,9 @@ public class MVWorld implements MultiverseWorld {
|
||||
}
|
||||
|
||||
public String getColoredWorldString() {
|
||||
if (this.getColor() == null) {
|
||||
return this.getAlias() + ChatColor.WHITE;
|
||||
}
|
||||
return this.getColor() + this.getAlias() + ChatColor.WHITE;
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,6 @@ public class ListCommand extends MultiverseCommand {
|
||||
String output = ChatColor.LIGHT_PURPLE + "Worlds which you can view:\n";
|
||||
for (MultiverseWorld world : this.plugin.getMVWorldManager().getMVWorlds()) {
|
||||
|
||||
|
||||
if (p != null && (!this.plugin.getMVPerms().canEnterWorld(p, world))) {
|
||||
continue;
|
||||
}
|
||||
@ -57,14 +56,14 @@ public class ListCommand extends MultiverseCommand {
|
||||
String outputCache = world.getColoredWorldString() + ChatColor.WHITE + " - " + color + world.getEnvironment() + " \n";
|
||||
if (world.isHidden()) {
|
||||
// TODO: Add an actual permission for this.
|
||||
if (p != null && !p.isOp()) {
|
||||
continue;
|
||||
if (p == null || p.isOp()) {
|
||||
// Prefix hidden worlds with an "[H]"
|
||||
outputCache = ChatColor.GRAY + "[H]" + outputCache;
|
||||
output += outputCache;
|
||||
}
|
||||
// Prefix hidden worlds with an "[H]"
|
||||
outputCache = ChatColor.GRAY + "[H]" + outputCache;
|
||||
} else {
|
||||
output += outputCache;
|
||||
}
|
||||
output += outputCache;
|
||||
|
||||
}
|
||||
String[] response = output.split("\n");
|
||||
for (String msg : response) {
|
||||
|
@ -47,6 +47,9 @@ public class MVPlayerListener extends PlayerListener {
|
||||
return;
|
||||
}
|
||||
MultiverseWorld mvworld = this.worldManager.getMVWorld(world);
|
||||
if(mvworld.isHidden()) {
|
||||
return;
|
||||
}
|
||||
prefix = mvworld.getColoredWorldString();
|
||||
String format = event.getFormat();
|
||||
event.setFormat("[" + prefix + "]" + format);
|
||||
|
Loading…
Reference in New Issue
Block a user