From 11ae0661fdfe6c1853b2832a64487fb334485cd6 Mon Sep 17 00:00:00 2001 From: DiddiZ Date: Sat, 17 Dec 2011 17:56:21 +0100 Subject: [PATCH] Make /lb logging tell if the world isn't logged --- src/de/diddiz/LogBlock/CommandsHandler.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/de/diddiz/LogBlock/CommandsHandler.java b/src/de/diddiz/LogBlock/CommandsHandler.java index aeddae9..8e7e0f8 100644 --- a/src/de/diddiz/LogBlock/CommandsHandler.java +++ b/src/de/diddiz/LogBlock/CommandsHandler.java @@ -114,12 +114,17 @@ public class CommandsHandler implements CommandExecutor world = ((Player)sender).getWorld(); if (world != null) { final WorldConfig wcfg = config.worlds.get(world.getName().hashCode()); - sender.sendMessage(ChatColor.DARK_AQUA + "Currently logging in " + world.getName() + ":"); - final List logging = new ArrayList(); - for (final Logging l : Logging.values()) - if (wcfg.isLogging(l)) - logging.add(l.toString()); - sender.sendMessage(ChatColor.GOLD + listing(logging, ", ", " and ")); + if (wcfg != null) { + sender.sendMessage(ChatColor.DARK_AQUA + "Currently logging in " + world.getName() + ":"); + final List logging = new ArrayList(); + for (final Logging l : Logging.values()) + if (wcfg.isLogging(l)) + logging.add(l.toString()); + sender.sendMessage(ChatColor.GOLD + listing(logging, ", ", " and ")); + } else { + sender.sendMessage(ChatColor.RED + "World not logged: '" + world.getName() + "'"); + sender.sendMessage(ChatColor.LIGHT_PURPLE + "Make the world name is listed at loggedWorlds in config. World names are case sensitive and must contains the path (if any), exactly like in the message above."); + } } else sender.sendMessage(ChatColor.RED + "No world specified"); } else