refactor: avoid duplicate code
This commit is contained in:
parent
c1880389de
commit
e81d45c2f5
1 changed files with 2 additions and 4 deletions
|
@ -48,13 +48,13 @@ public class NickoBukkit extends JavaPlugin {
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
plugin = this;
|
plugin = this;
|
||||||
|
nicko.initBukkit(this);
|
||||||
|
|
||||||
if (unitTesting) onUnitTestingStartup();
|
if (unitTesting) onUnitTestingStartup();
|
||||||
else onPluginStartup();
|
else onPluginStartup();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onUnitTestingStartup() {
|
public void onUnitTestingStartup() {
|
||||||
nicko.initBukkit(this);
|
|
||||||
|
|
||||||
if (!nicko.getDataStore().getStorage().getProvider().init()) {
|
if (!nicko.getDataStore().getStorage().getProvider().init()) {
|
||||||
nicko.getDataStore().getStorage().setError(true);
|
nicko.getDataStore().getStorage().setError(true);
|
||||||
getLogger().severe("Failed to open persistence, data will NOT be saved!");
|
getLogger().severe("Failed to open persistence, data will NOT be saved!");
|
||||||
|
@ -62,8 +62,6 @@ public class NickoBukkit extends JavaPlugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onPluginStartup() {
|
public void onPluginStartup() {
|
||||||
nicko.initBukkit(this);
|
|
||||||
|
|
||||||
getLogger().info("Loading internals...");
|
getLogger().info("Loading internals...");
|
||||||
if (getInternals() == null) {
|
if (getInternals() == null) {
|
||||||
getLogger().severe("Nicko could not find a valid implementation for this server version. Is your server supported?");
|
getLogger().severe("Nicko could not find a valid implementation for this server version. Is your server supported?");
|
||||||
|
|
Loading…
Reference in a new issue