diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ConfigCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/ConfigCommand.java index 35416e34..e03c0c1b 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/ConfigCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/ConfigCommand.java @@ -23,12 +23,13 @@ public class ConfigCommand extends MultiverseCommand { super(plugin); this.setName("Configuration"); this.setCommandUsage("/mv config " + ChatColor.GREEN + "{PROPERTY} {VALUE}"); - this.setArgRange(2, 2); + this.setArgRange(1, 2); this.addKey("mv config"); this.addKey("mvconfig"); this.addKey("mv conf"); this.addKey("mvconf"); this.addCommandExample("All values: " + ConfigProperty.getAllValues()); + this.addCommandExample("/mv config show"); this.addCommandExample("/mv config " + ChatColor.GREEN + "debug" + ChatColor.AQUA + " 3"); this.addCommandExample("/mv config " + ChatColor.GREEN + "enforceaccess" + ChatColor.AQUA + " false"); this.addCommandExample("/mv config " + ChatColor.GREEN + "bedrespawn" + ChatColor.AQUA + " true"); @@ -38,6 +39,22 @@ public class ConfigCommand extends MultiverseCommand { @Override public void runCommand(CommandSender sender, List args) { + if (args.size() <= 1) { + String[] allProps = ConfigProperty.getAllValues().split(" "); + String currentvals = ""; + for (String prop : allProps) { + currentvals += ChatColor.GREEN; + currentvals += prop; + currentvals += ChatColor.WHITE; + currentvals += " = "; + currentvals += ChatColor.GOLD; + currentvals += this.plugin.getMVConfiguration().get(prop, "NOT SET"); + currentvals += ChatColor.WHITE; + currentvals += ", "; + } + sender.sendMessage(currentvals.substring(0, currentvals.length() - 2)); + return; + } if (args.get(0).equalsIgnoreCase("messagecooldown") || args.get(0).equalsIgnoreCase("teleportcooldown") || args.get(0).equalsIgnoreCase("debug")) { try { this.plugin.getMVConfiguration().set(args.get(0).toLowerCase(), Integer.parseInt(args.get(1))); diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ListCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/ListCommand.java index 14458afe..e0323f23 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/ListCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/ListCommand.java @@ -40,7 +40,7 @@ public class ListCommand extends MultiverseCommand { String output = ChatColor.LIGHT_PURPLE + "Worlds which you can view:\n"; for (MultiverseWorld world : this.plugin.getMVWorldManager().getMVWorlds()) { - if (MultiverseCore.EnforceAccess && p != null && (!this.plugin.getMVPerms().canEnterWorld(p, world))) { + if (p != null && (!this.plugin.getMVPerms().canEnterWorld(p, world))) { continue; } diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/WhoCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/WhoCommand.java index 78e32c32..28fa6a72 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/WhoCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/WhoCommand.java @@ -77,7 +77,7 @@ public class WhoCommand extends MultiverseCommand { continue; } - if (MultiverseCore.EnforceAccess && p != null && (!this.plugin.getMVPerms().canEnterWorld(p, world))) { + if (p != null && (!this.plugin.getMVPerms().canEnterWorld(p, world))) { continue; } List players = world.getCBWorld().getPlayers(); diff --git a/src/main/java/com/onarandombox/MultiverseCore/utils/MVPermissions.java b/src/main/java/com/onarandombox/MultiverseCore/utils/MVPermissions.java index b1647711..ba11e78a 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/utils/MVPermissions.java +++ b/src/main/java/com/onarandombox/MultiverseCore/utils/MVPermissions.java @@ -78,6 +78,10 @@ public class MVPermissions implements PermissionsInterface { * @return */ public boolean canEnterWorld(Player p, MultiverseWorld w) { + // If we're not enforcing access, anyone can enter. + if (!MultiverseCore.EnforceAccess) { + return true; + } return this.hasPermission(p, "multiverse.access." + w.getName(), false); }