Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void reloadFile() {
- if (!theFile.exists()) {
- try {
- theFile.mkdirs();
- if (!theFile.createNewFile()) {
- throw new IOException("Failed to create the file.");
- }
- } catch (IOException e) {
- Logger.getLogger("Minecraft").severe("Failed to create the file.");
- }
- }
- theFileConfiguration = YamlConfiguration.loadConfiguration(theFile);
- InputStream defConfigStream = plugin.getResource("file.yml");
- if (defConfigStream != null) {
- YamlConfiguration defConfig = YamlConfiguration.loadConfiguration(defConfigStream);
- theFileConfiguration.setDefaults(defConfig);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement