forked from LogBlock/LogBlock
Load config in onLoad
This commit is contained in:
@@ -38,6 +38,7 @@ public class LogBlock extends JavaPlugin {
|
|||||||
private PlayerInfoLogging playerInfoLogging;
|
private PlayerInfoLogging playerInfoLogging;
|
||||||
private ScaffoldingLogging scaffoldingLogging;
|
private ScaffoldingLogging scaffoldingLogging;
|
||||||
private Questioner questioner;
|
private Questioner questioner;
|
||||||
|
private boolean isConfigLoaded;
|
||||||
private volatile boolean isCompletelyEnabled;
|
private volatile boolean isCompletelyEnabled;
|
||||||
|
|
||||||
public static LogBlock getInstance() {
|
public static LogBlock getInstance() {
|
||||||
@@ -57,20 +58,25 @@ public class LogBlock extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onLoad() {
|
||||||
logblock = this;
|
logblock = this;
|
||||||
|
|
||||||
BukkitUtils.isDoublePlant(Material.AIR); // Force static code to run
|
BukkitUtils.isDoublePlant(Material.AIR); // Force static code to run
|
||||||
final PluginManager pm = getPluginManager();
|
|
||||||
|
|
||||||
consumer = new Consumer(this);
|
|
||||||
try {
|
try {
|
||||||
Config.load(this);
|
Config.load(this);
|
||||||
|
isConfigLoaded = true;
|
||||||
} catch (final Exception ex) {
|
} catch (final Exception ex) {
|
||||||
getLogger().log(Level.SEVERE, "Could not load LogBlock config! " + ex.getMessage());
|
getLogger().log(Level.SEVERE, "Could not load LogBlock config! " + ex.getMessage(), ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEnable() {
|
||||||
|
final PluginManager pm = getPluginManager();
|
||||||
|
if (!isConfigLoaded) {
|
||||||
pm.disablePlugin(this);
|
pm.disablePlugin(this);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
consumer = new Consumer(this);
|
||||||
try {
|
try {
|
||||||
getLogger().info("Connecting to " + user + "@" + url + "...");
|
getLogger().info("Connecting to " + user + "@" + url + "...");
|
||||||
try {
|
try {
|
||||||
|
Reference in New Issue
Block a user