Skip to content

Commit

Permalink
Fix some code smells.
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Nov 9, 2019
1 parent c2e8d84 commit 4966a9c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/main/java/world/bentobox/a2b/A2B.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,11 @@ public void onLoad() {
public void onEnable(){
if(getAddonByName("BSkyBlock").map(BSkyBlock.class::cast).map(gm -> {
// Register commands
gm.getAdminCommand().ifPresent(adminCommand -> {
new AdminConvertCommand(adminCommand, gm);
});
gm.getAdminCommand().ifPresent(adminCommand -> new AdminConvertCommand(adminCommand, gm));
return false;
}).orElse(true)) {
logError("a2b requires BSkyBlock addon to be present! Disabling...");
this.setState(State.DISABLED);
return;
}

}
Expand All @@ -46,7 +43,10 @@ private void importASkyBlockconfig() {
return;
}
// Make a destination folder
this.getDataFolder().mkdirs();
if (!this.getDataFolder().mkdirs()) {
logError("Cannot make data folder!");
return;
}
// Make new config
File newConfig = new File(getDataFolder(), "config.yml");
// Copy to this folder
Expand All @@ -55,7 +55,6 @@ private void importASkyBlockconfig() {
} catch (IOException e1) {
logError("Cannot copy ASkyBlock config.yml file to a2b data folder! " + e1.getMessage());
this.setState(State.DISABLED);
return;
}
}

Expand Down

0 comments on commit 4966a9c

Please sign in to comment.