Added option to disable version check

This commit is contained in:
Robin Kupper
2011-09-08 19:05:42 +02:00
parent 3df37f7644
commit a8559b28e7
3 changed files with 7 additions and 3 deletions

View File

@@ -53,6 +53,7 @@ public class CommandsHandler implements CommandExecutor
try {
if (args.length == 0) {
sender.sendMessage(ChatColor.LIGHT_PURPLE + "LogBlock v" + logblock.getDescription().getVersion() + " by DiddiZ");
if (config.checkVersion)
sender.sendMessage(ChatColor.LIGHT_PURPLE + logblock.getUpdater().checkVersion());
sender.sendMessage(ChatColor.LIGHT_PURPLE + "Type /lb help for help");
} else {

View File

@@ -36,7 +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 boolean installSpout, checkVersion;
public final Set<Integer> hiddenPlayers, hiddenBlocks;
public static enum LogKillsLevel {
@@ -77,6 +77,7 @@ public class Config
def.put("questioner.askRollbackAfterBan", false);
def.put("questioner.banPermission", "mcbans.ban.local");
def.put("updater.installSpout", true);
def.put("updater.checkVersion", true);
tdef.put("aliases", Arrays.asList("t"));
tdef.put("leftClickBehavior", "NONE");
tdef.put("rightClickBehavior", "TOOL");
@@ -144,6 +145,7 @@ public class Config
askRollbackAfterBan = config.getBoolean("questioner.askRollbackAfterBan", false);
banPermission = config.getString("questioner.banPermission");
installSpout = config.getBoolean("updater.installSpout", true);
checkVersion = config.getBoolean("updater.checkVersion", true);
final List<String> toolNames = config.getKeys("tools");
System.out.println(toolNames.size());
final List<Tool> tools = new ArrayList<Tool>();

View File

@@ -65,8 +65,9 @@ public class LogBlock extends JavaPlugin
log = getServer().getLogger();
try {
updater = new Updater(this);
log.info("[LogBlock] Version check: " + updater.checkVersion());
config = new Config(this);
if (config.checkVersion)
log.info("[LogBlock] Version check: " + updater.checkVersion());
final File file = new File("lib/mysql-connector-java-bin.jar");
if (!file.exists() || file.length() == 0)
download(log, new URL("http://diddiz.insane-architects.net/download/mysql-connector-java-bin.jar"), file);