From 3df37f7644a77afcf0c3d6169a3f15f7fd90f95a Mon Sep 17 00:00:00 2001 From: Robin Kupper Date: Thu, 8 Sep 2011 19:00:27 +0200 Subject: [PATCH] Added option to disable auto spout downloading --- src/de/diddiz/LogBlock/Config.java | 3 +++ src/de/diddiz/LogBlock/LogBlock.java | 18 ++++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/de/diddiz/LogBlock/Config.java b/src/de/diddiz/LogBlock/Config.java index 90ca776..08c6614 100644 --- a/src/de/diddiz/LogBlock/Config.java +++ b/src/de/diddiz/LogBlock/Config.java @@ -36,6 +36,7 @@ public class Config public final int linesPerPage, linesLimit; public final boolean askRollbacks, askRedos, askClearLogs, askClearLogAfterRollback, askRollbackAfterBan; public final String banPermission; + public final boolean installSpout; public final Set hiddenPlayers, hiddenBlocks; public static enum LogKillsLevel { @@ -75,6 +76,7 @@ public class Config def.put("questioner.askClearLogAfterRollback", true); def.put("questioner.askRollbackAfterBan", false); def.put("questioner.banPermission", "mcbans.ban.local"); + def.put("updater.installSpout", true); tdef.put("aliases", Arrays.asList("t")); tdef.put("leftClickBehavior", "NONE"); tdef.put("rightClickBehavior", "TOOL"); @@ -141,6 +143,7 @@ public class Config askClearLogAfterRollback = config.getBoolean("questioner.askClearLogAfterRollback", true); askRollbackAfterBan = config.getBoolean("questioner.askRollbackAfterBan", false); banPermission = config.getString("questioner.banPermission"); + installSpout = config.getBoolean("updater.installSpout", true); final List toolNames = config.getKeys("tools"); System.out.println(toolNames.size()); final List tools = new ArrayList(); diff --git a/src/de/diddiz/LogBlock/LogBlock.java b/src/de/diddiz/LogBlock/LogBlock.java index e168a0d..0f40964 100644 --- a/src/de/diddiz/LogBlock/LogBlock.java +++ b/src/de/diddiz/LogBlock/LogBlock.java @@ -141,12 +141,18 @@ public class LogBlock extends JavaPlugin log.warning("[LogBlock] Failed to download WorldEdit. You may have to download it manually. You don't have to install it, just place the jar in the lib folder."); } if (config.logChestAccess && pm.getPlugin("Spout") == null) - try { - download(log, new URL("http://ci.getspout.org/job/Spout/Recommended/artifact/target/spout-dev-SNAPSHOT.jar"), new File("plugins/Spout.jar")); - pm.loadPlugin(new File("plugins/Spout.jar")); - pm.enablePlugin(pm.getPlugin("Spout")); - } catch (final Exception ex) { - log.warning("[LogBlock] Failed to install Spout, you may have to restart your server or install it manually."); + if (config.installSpout) + try { + download(log, new URL("http://ci.getspout.org/job/Spout/Recommended/artifact/target/spout-dev-SNAPSHOT.jar"), new File("plugins/Spout.jar")); + pm.loadPlugin(new File("plugins/Spout.jar")); + pm.enablePlugin(pm.getPlugin("Spout")); + } catch (final Exception ex) { + config.logChestAccess = false; + log.warning("[LogBlock] Failed to install Spout, you may have to restart your server or install it manually."); + } + else { + config.logChestAccess = false; + log.warning("[LogBlock] Spout is not installed. Disabling chest logging."); } commandsHandler = new CommandsHandler(this); getCommand("lb").setExecutor(commandsHandler);