diff --git a/src/com/wasteofplastic/askyblock/Island.java b/src/com/wasteofplastic/askyblock/Island.java index dc2d3de13..583b25aed 100644 --- a/src/com/wasteofplastic/askyblock/Island.java +++ b/src/com/wasteofplastic/askyblock/Island.java @@ -400,7 +400,12 @@ public void setIgsDefaults() { // Default default this.igs.put(flag, false); } else { - this.igs.put(flag, Settings.defaultIslandSettings.get(flag)); + if (Settings.defaultIslandSettings.get(flag) == null) { + //plugin.getLogger().info("DEBUG: null flag " + flag); + this.igs.put(flag, false); + } else { + this.igs.put(flag, Settings.defaultIslandSettings.get(flag)); + } } } } @@ -414,7 +419,11 @@ public void setSpawnDefaults() { // Default default this.igs.put(flag, false); } else { - this.igs.put(flag, Settings.defaultSpawnSettings.get(flag)); + if (Settings.defaultSpawnSettings.get(flag) == null) { + this.igs.put(flag, false); + } else { + this.igs.put(flag, Settings.defaultSpawnSettings.get(flag)); + } } } } diff --git a/src/com/wasteofplastic/askyblock/PluginConfig.java b/src/com/wasteofplastic/askyblock/PluginConfig.java index 957fd17f8..2e15a631f 100644 --- a/src/com/wasteofplastic/askyblock/PluginConfig.java +++ b/src/com/wasteofplastic/askyblock/PluginConfig.java @@ -781,9 +781,10 @@ public static boolean loadPluginConfig(ASkyBlock plugin) { for (String setting: protectionWorld.getKeys(false)) { try { SettingsFlag flag = SettingsFlag.valueOf(setting.toUpperCase()); - Settings.defaultWorldSettings.put(flag, plugin.getConfig().getBoolean("protection.world." + flag.name())); - Settings.defaultSpawnSettings.put(flag, Settings.defaultWorldSettings.get(flag)); - Settings.defaultIslandSettings.put(flag, Settings.defaultWorldSettings.get(flag)); + boolean value = plugin.getConfig().getBoolean("protection.world." + flag.name()); + Settings.defaultWorldSettings.put(flag, value); + Settings.defaultSpawnSettings.put(flag, value); + Settings.defaultIslandSettings.put(flag, value); } catch (Exception e) { plugin.getLogger().severe("Unknown setting in config.yml:protection.world " + setting.toUpperCase() + " skipping..."); } @@ -794,6 +795,12 @@ public static boolean loadPluginConfig(ASkyBlock plugin) { plugin.getLogger().warning("config.yml:protection.world."+flag.name() + " is missing. You should add it to the config file. Setting to false by default"); Settings.defaultWorldSettings.put(flag, false); } + if (!Settings.defaultIslandSettings.containsKey(flag)) { + Settings.defaultIslandSettings.put(flag, false); + } + if (!Settings.defaultSpawnSettings.containsKey(flag)) { + Settings.defaultSpawnSettings.put(flag, false); + } } ConfigurationSection protectionIsland = plugin.getConfig().getConfigurationSection("protection.island"); for (String setting: protectionIsland.getKeys(false)) { @@ -807,7 +814,6 @@ public static boolean loadPluginConfig(ASkyBlock plugin) { plugin.getLogger().severe("Unknown setting in config.yml:island.world " + setting.toUpperCase() + " skipping..."); } } - // ******************** Biome Settings ********************* Settings.biomeCost = plugin.getConfig().getDouble("biomesettings.defaultcost", 100D); if (Settings.biomeCost < 0D) {