use of com.eintosti.buildsystem.object.world.data.WorldStatus in project BuildSystem by einTosti.
the class WorldManager method loadWorld.
public BuildWorld loadWorld(String worldName) {
FileConfiguration configuration = worldConfig.getFile();
if (configuration == null) {
return null;
}
String creator = configuration.isString("worlds." + worldName + ".creator") ? configuration.getString("worlds." + worldName + ".creator") : "-";
UUID creatorId = parseCreatorId(configuration, worldName, creator);
WorldType worldType = configuration.isString("worlds." + worldName + ".type") ? WorldType.valueOf(configuration.getString("worlds." + worldName + ".type")) : WorldType.UNKNOWN;
boolean privateWorld = configuration.isBoolean("worlds." + worldName + ".private") && configuration.getBoolean("worlds." + worldName + ".private");
XMaterial material = parseMaterial(configuration, worldName);
WorldStatus worldStatus = WorldStatus.valueOf(configuration.getString("worlds." + worldName + ".status"));
String project = configuration.getString("worlds." + worldName + ".project");
String permission = configuration.getString("worlds." + worldName + ".permission");
long date = configuration.isLong("worlds." + worldName + ".date") ? configuration.getLong("worlds." + worldName + ".date") : -1;
boolean physics = configuration.getBoolean("worlds." + worldName + ".physics");
boolean explosions = !configuration.isBoolean("worlds." + worldName + ".explosions") || configuration.getBoolean("worlds." + worldName + ".explosions");
boolean mobAI = !configuration.isBoolean("worlds." + worldName + ".mobai") || configuration.getBoolean("worlds." + worldName + ".mobai");
String customSpawn = configuration.getString("worlds." + worldName + ".spawn");
boolean blockBreaking = !configuration.isBoolean("worlds." + worldName + ".block-breaking") || configuration.getBoolean("worlds." + worldName + ".block-breaking");
boolean blockPlacement = !configuration.isBoolean("worlds." + worldName + ".block-placement") || configuration.getBoolean("worlds." + worldName + ".block-placement");
boolean blockInteractions = !configuration.isBoolean("worlds." + worldName + ".block-interactions") || configuration.getBoolean("worlds." + worldName + ".block-interactions");
boolean buildersEnabled = configuration.isBoolean("worlds." + worldName + ".builders-enabled") && configuration.getBoolean("worlds." + worldName + ".builders-enabled");
List<Builder> builders = parseBuilders(configuration, worldName);
String chunkGeneratorString = configuration.getString("worlds." + worldName + ".chunk-generator");
ChunkGenerator chunkGenerator = parseChunkGenerator(configuration, worldName);
if (worldType == WorldType.PRIVATE) {
privateWorld = true;
worldType = WorldType.FLAT;
}
BuildWorld buildWorld = new BuildWorld(plugin, worldName, creator, creatorId, worldType, privateWorld, material, worldStatus, project, permission, date, physics, explosions, mobAI, customSpawn, blockBreaking, blockPlacement, blockInteractions, buildersEnabled, builders, chunkGenerator, chunkGeneratorString);
buildWorlds.add(buildWorld);
return buildWorld;
}
use of com.eintosti.buildsystem.object.world.data.WorldStatus in project BuildSystem by Trichtern.
the class WorldManager method loadWorld.
public BuildWorld loadWorld(String worldName) {
FileConfiguration configuration = worldConfig.getFile();
if (configuration == null) {
return null;
}
String creator = configuration.isString("worlds." + worldName + ".creator") ? configuration.getString("worlds." + worldName + ".creator") : "-";
UUID creatorId = parseCreatorId(configuration, worldName, creator);
WorldType worldType = configuration.isString("worlds." + worldName + ".type") ? WorldType.valueOf(configuration.getString("worlds." + worldName + ".type")) : WorldType.UNKNOWN;
boolean privateWorld = configuration.isBoolean("worlds." + worldName + ".private") && configuration.getBoolean("worlds." + worldName + ".private");
XMaterial material = parseMaterial(configuration, worldName);
WorldStatus worldStatus = WorldStatus.valueOf(configuration.getString("worlds." + worldName + ".status"));
String project = configuration.getString("worlds." + worldName + ".project");
String permission = configuration.getString("worlds." + worldName + ".permission");
long date = configuration.isLong("worlds." + worldName + ".date") ? configuration.getLong("worlds." + worldName + ".date") : -1;
boolean physics = configuration.getBoolean("worlds." + worldName + ".physics");
boolean explosions = !configuration.isBoolean("worlds." + worldName + ".explosions") || configuration.getBoolean("worlds." + worldName + ".explosions");
boolean mobAI = !configuration.isBoolean("worlds." + worldName + ".mobai") || configuration.getBoolean("worlds." + worldName + ".mobai");
String customSpawn = configuration.getString("worlds." + worldName + ".spawn");
boolean blockBreaking = !configuration.isBoolean("worlds." + worldName + ".block-breaking") || configuration.getBoolean("worlds." + worldName + ".block-breaking");
boolean blockPlacement = !configuration.isBoolean("worlds." + worldName + ".block-placement") || configuration.getBoolean("worlds." + worldName + ".block-placement");
boolean blockInteractions = !configuration.isBoolean("worlds." + worldName + ".block-interactions") || configuration.getBoolean("worlds." + worldName + ".block-interactions");
boolean buildersEnabled = configuration.isBoolean("worlds." + worldName + ".builders-enabled") && configuration.getBoolean("worlds." + worldName + ".builders-enabled");
Difficulty difficulty = Difficulty.valueOf(configuration.getString("worlds." + worldName + ".difficulty", "PEACEFUL").toUpperCase());
List<Builder> builders = parseBuilders(configuration, worldName);
String chunkGeneratorString = configuration.getString("worlds." + worldName + ".chunk-generator");
ChunkGenerator chunkGenerator = parseChunkGenerator(configuration, worldName);
BuildWorld buildWorld = new BuildWorld(plugin, worldName, creator, creatorId, worldType, privateWorld, material, worldStatus, project, permission, date, physics, explosions, mobAI, customSpawn, blockBreaking, blockPlacement, blockInteractions, buildersEnabled, difficulty, builders, chunkGenerator, chunkGeneratorString);
buildWorlds.add(buildWorld);
return buildWorld;
}
Aggregations