mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-09-07 04:48:07 +02:00
parent
d33be37694
commit
1224d3b443
@ -25,6 +25,7 @@
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import com.sk89q.util.yaml.YAMLFormat;
|
||||||
import com.sk89q.util.yaml.YAMLProcessor;
|
import com.sk89q.util.yaml.YAMLProcessor;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -101,7 +102,7 @@ public void load() {
|
|||||||
plugin.createDefaultConfiguration(
|
plugin.createDefaultConfiguration(
|
||||||
new File(plugin.getDataFolder(), "config.yml"), "config.yml");
|
new File(plugin.getDataFolder(), "config.yml"), "config.yml");
|
||||||
|
|
||||||
YAMLProcessor config = new YAMLProcessor(new File(plugin.getDataFolder(), "config.yml"), true);
|
YAMLProcessor config = new YAMLProcessor(new File(plugin.getDataFolder(), "config.yml"), true, YAMLFormat.EXTENDED);
|
||||||
try {
|
try {
|
||||||
config.load();
|
config.load();
|
||||||
} catch (IOException ignore) {}
|
} catch (IOException ignore) {}
|
||||||
@ -115,6 +116,8 @@ public void load() {
|
|||||||
usePlayerMove = config.getBoolean(
|
usePlayerMove = config.getBoolean(
|
||||||
"use-player-move-event", true);
|
"use-player-move-event", true);
|
||||||
|
|
||||||
|
config.setWriteDefaults(false);
|
||||||
|
|
||||||
// Load configurations for each world
|
// Load configurations for each world
|
||||||
for (World world : plugin.getServer().getWorlds()) {
|
for (World world : plugin.getServer().getWorlds()) {
|
||||||
get(world);
|
get(world);
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
import com.sk89q.util.yaml.YAMLFormat;
|
||||||
import com.sk89q.util.yaml.YAMLProcessor;
|
import com.sk89q.util.yaml.YAMLProcessor;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.entity.CreatureType;
|
import org.bukkit.entity.CreatureType;
|
||||||
@ -167,12 +168,12 @@ public WorldConfiguration(WorldGuardPlugin plugin, String worldName) {
|
|||||||
|
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.worldName = worldName;
|
this.worldName = worldName;
|
||||||
this.parentConfig = new YAMLProcessor(new File(plugin.getDataFolder(), "config.yml"), false);
|
this.parentConfig = new YAMLProcessor(new File(plugin.getDataFolder(), "config.yml"), false, YAMLFormat.EXTENDED);
|
||||||
|
|
||||||
plugin.createDefaultConfiguration(configFile, "config_world.yml");
|
plugin.createDefaultConfiguration(configFile, "config_world.yml");
|
||||||
plugin.createDefaultConfiguration(blacklistFile, "blacklist.txt");
|
plugin.createDefaultConfiguration(blacklistFile, "blacklist.txt");
|
||||||
|
|
||||||
config = new YAMLProcessor(this.configFile, true);
|
config = new YAMLProcessor(this.configFile, true, YAMLFormat.EXTENDED);
|
||||||
loadConfiguration();
|
loadConfiguration();
|
||||||
|
|
||||||
logger.info("WorldGuard: Loaded configuration for world '" + worldName + '"');
|
logger.info("WorldGuard: Loaded configuration for world '" + worldName + '"');
|
||||||
|
Loading…
Reference in New Issue
Block a user