Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 into develop
  • Loading branch information
tastybento committed Jul 23, 2023
2 parents d2b955f + 77b94ee commit 49ad718
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/main/java/world/bentobox/aoneblock/AOneBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,13 @@ private boolean loadSettings() {

@Override
public void onEnable() {
loadData();

oneBlockManager = new OneBlocksManager(this);
if (loadData()) {
// Failed to load - don't register anything
return;
}
blockListener = new BlockListener(this);
registerListener(blockListener);
registerListener(new NoBlockHandler(this));
registerListener(new BlockProtect(this));
registerListener(new JoinLeaveListener(this));
Expand All @@ -106,20 +111,18 @@ public void onEnable() {
registerListener(holoListener);
}

//Load some of Manager
public void loadData() {
// Load phase data
public boolean loadData() {
try {
oneBlockManager = new OneBlocksManager(this);
oneBlockManager.loadPhases();
blockListener = new BlockListener(this);
} catch (IOException e) {
// Disable
logError("AOneBlock settings could not load (oneblock.yml error)! Addon disabled.");
logError(e.getMessage());
setState(State.DISABLED);
return;
return true;
}
registerListener(blockListener);
return false;
}

private void registerPlaceholders() {
Expand Down

0 comments on commit 49ad718

Please sign in to comment.