mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 14:46:46 +01:00
fixing NPE and IO errors
This commit is contained in:
parent
bf63ce33c5
commit
fb2eddd432
@ -16,7 +16,7 @@ public class AdvancedConfig extends ConfigLoaderConfigurable {
|
|||||||
private static AdvancedConfig instance;
|
private static AdvancedConfig instance;
|
||||||
|
|
||||||
private AdvancedConfig() {
|
private AdvancedConfig() {
|
||||||
super(mcMMO.p.getDataFolder(), "advanced.yml");
|
super(mcMMO.p.getDataFolder().getAbsoluteFile(), "advanced.yml");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static AdvancedConfig getInstance() {
|
public static AdvancedConfig getInstance() {
|
||||||
|
@ -39,7 +39,6 @@ public abstract class ConfigLoaderConfigurable implements DefaultKeys {
|
|||||||
|
|
||||||
private ConfigurationNode userRootNode = null;
|
private ConfigurationNode userRootNode = null;
|
||||||
private ConfigurationNode defaultRootNode = null;
|
private ConfigurationNode defaultRootNode = null;
|
||||||
private CommentedConfigurationNode userCommentedRootNode = null;
|
|
||||||
|
|
||||||
/* CONFIG MANAGER */
|
/* CONFIG MANAGER */
|
||||||
private ConfigurationLoader<CommentedConfigurationNode> configManager;
|
private ConfigurationLoader<CommentedConfigurationNode> configManager;
|
||||||
@ -111,9 +110,6 @@ public abstract class ConfigLoaderConfigurable implements DefaultKeys {
|
|||||||
final ConfigurationNode userConfig = this.userCopyLoader.load();
|
final ConfigurationNode userConfig = this.userCopyLoader.load();
|
||||||
userRootNode = userConfig;
|
userRootNode = userConfig;
|
||||||
|
|
||||||
//TESTING THIS
|
|
||||||
userCommentedRootNode = configManager.load();
|
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@ -188,7 +184,10 @@ public abstract class ConfigLoaderConfigurable implements DefaultKeys {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!targetFile.exists())
|
if(!targetFile.exists())
|
||||||
|
{
|
||||||
|
targetFile.getParentFile().mkdirs();
|
||||||
targetFile.createNewFile(); //New File Boys
|
targetFile.createNewFile(); //New File Boys
|
||||||
|
}
|
||||||
|
|
||||||
Files.write(buffer, targetFile);
|
Files.write(buffer, targetFile);
|
||||||
mcMMO.p.getLogger().info("Created config file - " + relativeOutputPath);
|
mcMMO.p.getLogger().info("Created config file - " + relativeOutputPath);
|
||||||
|
@ -13,7 +13,7 @@ public class ConfigurableTest extends ConfigLoaderConfigurable {
|
|||||||
private static ConfigurableTest instance;
|
private static ConfigurableTest instance;
|
||||||
|
|
||||||
public ConfigurableTest() {
|
public ConfigurableTest() {
|
||||||
super(mcMMO.p.getDataFolder(), relativePath);
|
super(mcMMO.p.getDataFolder().getAbsoluteFile(), relativePath);
|
||||||
|
|
||||||
mcMMO.p.getLogger().severe("The value of bone "+boneValue);
|
mcMMO.p.getLogger().severe("The value of bone "+boneValue);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user