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() {
|
public String getColoredWorldString() {
|
||||||
|
if (this.getColor() == null) {
|
||||||
|
return this.getAlias() + ChatColor.WHITE;
|
||||||
|
}
|
||||||
return this.getColor() + 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";
|
String output = ChatColor.LIGHT_PURPLE + "Worlds which you can view:\n";
|
||||||
for (MultiverseWorld world : this.plugin.getMVWorldManager().getMVWorlds()) {
|
for (MultiverseWorld world : this.plugin.getMVWorldManager().getMVWorlds()) {
|
||||||
|
|
||||||
|
|
||||||
if (p != null && (!this.plugin.getMVPerms().canEnterWorld(p, world))) {
|
if (p != null && (!this.plugin.getMVPerms().canEnterWorld(p, world))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -57,14 +56,14 @@ public class ListCommand extends MultiverseCommand {
|
|||||||
String outputCache = world.getColoredWorldString() + ChatColor.WHITE + " - " + color + world.getEnvironment() + " \n";
|
String outputCache = world.getColoredWorldString() + ChatColor.WHITE + " - " + color + world.getEnvironment() + " \n";
|
||||||
if (world.isHidden()) {
|
if (world.isHidden()) {
|
||||||
// TODO: Add an actual permission for this.
|
// TODO: Add an actual permission for this.
|
||||||
if (p != null && !p.isOp()) {
|
if (p == null || p.isOp()) {
|
||||||
continue;
|
// Prefix hidden worlds with an "[H]"
|
||||||
|
outputCache = ChatColor.GRAY + "[H]" + outputCache;
|
||||||
|
output += outputCache;
|
||||||
}
|
}
|
||||||
// Prefix hidden worlds with an "[H]"
|
} else {
|
||||||
outputCache = ChatColor.GRAY + "[H]" + outputCache;
|
output += outputCache;
|
||||||
}
|
}
|
||||||
output += outputCache;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
String[] response = output.split("\n");
|
String[] response = output.split("\n");
|
||||||
for (String msg : response) {
|
for (String msg : response) {
|
||||||
|
@ -47,6 +47,9 @@ public class MVPlayerListener extends PlayerListener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
MultiverseWorld mvworld = this.worldManager.getMVWorld(world);
|
MultiverseWorld mvworld = this.worldManager.getMVWorld(world);
|
||||||
|
if(mvworld.isHidden()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
prefix = mvworld.getColoredWorldString();
|
prefix = mvworld.getColoredWorldString();
|
||||||
String format = event.getFormat();
|
String format = event.getFormat();
|
||||||
event.setFormat("[" + prefix + "]" + format);
|
event.setFormat("[" + prefix + "]" + format);
|
||||||
|
Loading…
Reference in New Issue
Block a user