Skip to content

Commit

Permalink
change where plugin dir gets created
Browse files Browse the repository at this point in the history
  • Loading branch information
xGinko committed Mar 27, 2024
1 parent 62d48de commit edf6b2f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ public void onEnable() {
logger.info(Component.text(" \\_/\\_/\\___/_| |_\\__,_|___/\\__\\__,_|\\__/__/").style(KyoriUtil.GUPPIE_GREEN_BOLD));
logger.info(Component.text(" ").style(KyoriUtil.GUPPIE_GREEN_BOLD));

try {
getDataFolder().mkdirs();
} catch (Throwable t) {
logger.error("Failed to create plugin folder!", t);
getServer().getPluginManager().disablePlugin(this);
}

logger.info("Loading languages");
reloadLang();
logger.info("Loading config");
Expand Down
7 changes: 1 addition & 6 deletions src/main/java/me/xginko/betterworldstats/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,7 @@ public class Config {
public final double additional_spoof_filesize;

public Config() throws Exception {
// Create plugin folder first if it does not exist yet
File pluginFolder = BetterWorldStats.getInstance().getDataFolder();
if (!pluginFolder.exists() && !pluginFolder.mkdir())
BetterWorldStats.getLog().error("Failed to create plugin folder.");
// Load config.yml with ConfigMaster
this.configFile = ConfigFile.loadConfig(new File(pluginFolder, "config.yml"));
this.configFile = ConfigFile.loadConfig(new File(BetterWorldStats.getInstance().getDataFolder(), "config.yml"));

// Title
this.configFile.setTitle(new Title()
Expand Down

0 comments on commit edf6b2f

Please sign in to comment.