// Soft Dependency evaluation beforehands
isSpoutPluginEnabled = CommonUtil.isPluginEnabled("Spout");
isMultiverseEnabled = CommonUtil.isPluginEnabled(MULTIVERSE_NAME);
// Continue loading the configuration(s)
FileConfiguration config = new FileConfiguration(this);
config.load();
config.setHeader("This is the configuration of MyWorlds");
config.addHeader("For more information, you can visit the following websites:");
config.addHeader("http://dev.bukkit.org/server-mods/my-worlds/");
config.addHeader("http://forums.bukkit.org/threads/myworlds.31718");
config.setHeader("teleportInterval", "\nThe interval in miliseconds a player has to wait before being teleported again");
teleportInterval = config.get("teleportInterval", 2000);
config.setHeader("useWaterTeleport", "\nWhether water stream portals are allowed");
useWaterTeleport = config.get("useWaterTeleport", true);
config.setHeader("timeLockInterval", "\nThe tick interval at which time is kept locked");
timeLockInterval = config.get("timeLockInterval", 20);
config.setHeader("useWorldInventories", "\nWhether or not world inventories are being separated using the settings");
useWorldInventories = config.get("useWorldInventories", false);
useWorldEnterPermissions = config.get("useWorldEnterPermissions", false);
usePortalEnterPermissions = config.get("usePortalEnterPermissions", false);
useWorldBuildPermissions = config.get("useWorldBuildPermissions", false);
useWorldUsePermissions = config.get("useWorldUsePermissions", false);
useWorldChatPermissions = config.get("useWorldChatPermissions", false);
config.setHeader("onlyPlayerTeleportation", "\nWhether only players are allowed to teleport through portals");
onlyPlayerTeleportation = config.get("onlyPlayerTeleportation", true);
config.setHeader("allowPortalNameOverride", "\nWhether portals can be replaced by other portals with the same name on the same world");
allowPortalNameOverride = config.get("allowPortalNameOverride", true);
config.setHeader("useWorldOperators", "\nWhether each world has it's own operator list");
useWorldOperators = config.get("useWorldOperators", false);
config.setHeader("onlyObsidianPortals", "\nWhether only portal blocks surrounded by obsidian can teleport players");
onlyObsidianPortals = config.get("onlyObsidianPortals", false);
config.setHeader("calculateWorldSize", "\nWhether the world info command will calculate the world size on disk");
config.addHeader("calculateWorldSize", "If this process takes too long, disable it to prevent possible server freezes");
calculateWorldSize = config.get("calculateWorldSize", true);
config.setHeader("mainWorld", "\nThe main world in which new players spawn");
config.addHeader("mainWorld", "If left empty, the main world defined in the server.properties is used");
mainWorld = config.get("mainWorld", "");
config.setHeader("forceMainWorldSpawn", "\nWhether all players respawn on the main world at all times");
forceMainWorldSpawn = config.get("forceMainWorldSpawn", false);
config.setHeader("alwaysInstantPortal", "\nWhether survival players instantly teleport when entering a nether portal");
alwaysInstantPortal = config.get("alwaysInstantPortal", true);
config.setHeader("maxPortalSignDistance", "\nThe maximum distance to look for a portal sign when entering a portal");
maxPortalSignDistance = config.get("maxPortalSignDistance", 5.0);
config.setHeader("enablePortals", "\nTurns portal usage on or off on a global level");
config.addHeader("enablePortals", "When disabled, portal teleportation will not be handled by MyWorlds whatsoever");
enablePortals = config.get("enablePortals", true);
config.setHeader("allowPersonalPortals", "\nWhether individually placed nether/end portals create their own destination portal");
config.addHeader("allowPersonalPortals", "False: Players are teleported to the spawn point of the world");
config.addHeader("allowPersonalPortals", "True: Players are teleported to their own portal on the other world");
allowPersonalPortals = config.get("allowPersonalPortals", true);
config.setHeader("ignoreEggSpawns", "\nWhether egg-spawned entities are allowed to spawn, even if worlds have these entities blacklisted");
ignoreEggSpawns = config.get("ignoreEggSpawns", true);
config.setHeader("overridePortalPhysics", "\nWhether Vanilla portal physics are overrided to allow them to be built/stacked");
overridePortalPhysics = config.get("overridePortalPhysics", true);
config.setHeader("importFromMultiVerse", "\nWhether to automatically import the world configuration of MultiVerse for new (unknown) worlds");
config.addHeader("importFromMultiverse", "Note that default world properties are then no longer applied, as MultiVerse takes that over");
config.addHeader("importFromMultiverse", "This setting is only active if MultiVerse-Core is installed.");
importFromMultiVerse = config.get("importFromMultiVerse", true);
config.save();
// World configurations have to be loaded first
WorldConfig.init();
// Portals