forked from LogBlock/LogBlock
add version check
This commit is contained in:
@@ -11,6 +11,7 @@ import net.minecraft.server.MinecraftServer;
|
|||||||
|
|
||||||
public class LogBlock extends Plugin
|
public class LogBlock extends Plugin
|
||||||
{
|
{
|
||||||
|
private boolean versionCheck = true;
|
||||||
private String name = "LogBlock";
|
private String name = "LogBlock";
|
||||||
private int version = 6;
|
private int version = 6;
|
||||||
private String dbDriver = "com.mysql.jdbc.Driver";
|
private String dbDriver = "com.mysql.jdbc.Driver";
|
||||||
@@ -37,10 +38,10 @@ public class LogBlock extends Plugin
|
|||||||
delay = properties.getInt("delay", 10);
|
delay = properties.getInt("delay", 10);
|
||||||
toolID = properties.getInt("tool-id", 270);
|
toolID = properties.getInt("tool-id", 270);
|
||||||
defaultDist = properties.getInt("default-distance", 20);
|
defaultDist = properties.getInt("default-distance", 20);
|
||||||
|
versionCheck = properties.getBoolean("boots-version-check", true);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
log.log(Level.SEVERE, "Exception while reading from logblock.properties", ex);
|
log.log(Level.SEVERE, "Exception while reading from logblock.properties", ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
new JDCConnectionDriver(dbDriver, dbUrl, dbUsername, dbPassword);
|
new JDCConnectionDriver(dbDriver, dbUrl, dbUsername, dbPassword);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
@@ -62,6 +63,8 @@ public class LogBlock extends Plugin
|
|||||||
|
|
||||||
public void initialize()
|
public void initialize()
|
||||||
{
|
{
|
||||||
|
new VersionCheck(name, version, versionCheck);
|
||||||
|
|
||||||
LBListener listener = new LBListener();
|
LBListener listener = new LBListener();
|
||||||
etc.getLoader().addListener(PluginLoader.Hook.COMMAND, listener, this, PluginListener.Priority.LOW);
|
etc.getLoader().addListener(PluginLoader.Hook.COMMAND, listener, this, PluginListener.Priority.LOW);
|
||||||
etc.getLoader().addListener(PluginLoader.Hook.BLOCK_CREATED, listener, this, PluginListener.Priority.LOW);
|
etc.getLoader().addListener(PluginLoader.Hook.BLOCK_CREATED, listener, this, PluginListener.Priority.LOW);
|
||||||
|
Reference in New Issue
Block a user