Temporary debug mode using /essentials debug

This commit is contained in:
snowleo 2011-11-04 02:43:43 +01:00
parent 02cc1b9fe9
commit 8890284b3e
3 changed files with 17 additions and 1 deletions

View File

@ -136,4 +136,6 @@ public interface ISettings extends IConf
boolean getFreezeAfkPlayers();
boolean areDeathMessagesEnabled();
public void setDebug(boolean debug);
}

View File

@ -378,10 +378,12 @@ public class Settings implements ISettings
return config.getBoolean("protect.disable.warn-on-build-disallow", false);
}
private boolean debug = false;
@Override
public boolean isDebug()
{
return config.getBoolean("debug", false);
return debug || config.getBoolean("debug", false);
}
@Override
@ -532,4 +534,10 @@ public class Settings implements ISettings
{
return config.getBoolean("death-messages", true);
}
@Override
public void setDebug(final boolean debug)
{
this.debug = debug;
}
}

View File

@ -23,6 +23,12 @@ public class Commandessentials extends EssentialsCommand
@Override
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
if (args.length > 0 && args[0].equalsIgnoreCase("debug"))
{
ess.getSettings().setDebug(!ess.getSettings().isDebug());
sender.sendMessage("Essentials " + ess.getDescription().getVersion() + " debug mode " + (ess.getSettings().isDebug() ? "enabled" : "disabled"));
return;
}
final Map<String, Byte> noteMap = new HashMap<String, Byte>();
noteMap.put("1F#", (byte)0x0);
noteMap.put("1G", (byte)0x1);