Implemented #51

This commit is contained in:
Butzlabben 2020-02-03 20:34:08 +01:00
parent 7a3a9da15f
commit 14a5dd7657
3 changed files with 11 additions and 3 deletions

View File

@ -68,7 +68,7 @@ public class WorldSystem extends JavaPlugin {
MessageConfig.checkConfig(new File(languages, "zh.yml"));
MessageConfig.checkConfig(new File(languages, "fr.yml"));
// If has custom language
// If has custom language
MessageConfig.checkConfig(new File(languages, PluginConfig.getLanguage() + ".yml"));
if (!dconfig.exists()) {
@ -164,7 +164,8 @@ public class WorldSystem extends JavaPlugin {
// Choose right creatoradapter for #16
if (Bukkit.getPluginManager().getPlugin("FastAsyncWorldEdit") != null
&& Bukkit.getPluginManager().getPlugin("WorldEdit") != null) {
&& Bukkit.getPluginManager().getPlugin("WorldEdit") != null
&& PluginConfig.loadWorldsASync()) {
creator = new AsyncCreatorAdapter();
Bukkit.getConsoleSender()
.sendMessage(PluginConfig.getPrefix() + "Found FAWE! Try now to create worlds async");

View File

@ -36,7 +36,7 @@ public class PluginConfig {
&& cfg.isInt("request_expires") && cfg.isBoolean("need_confirm")
&& cfg.isBoolean("contact_authserver") && cfg.isBoolean("spawn_teleportation")
&& cfg.isInt("delete_after") && cfg.isBoolean("worldtemplates.multi_choose")
&& cfg.isString("worldtemplates.default") &&
&& cfg.isString("worldtemplates.default") && cfg.isBoolean("load_worlds_async") &&
// Database stuff
cfg.isString("database.type") && cfg.isString("database.worlds_table_name") && cfg.isString("database.players_table_name")
@ -235,4 +235,8 @@ public class PluginConfig {
public static String getMysqlDatabaseName() {
return getConfig().getString("database.mysql_settings.database");
}
public static boolean loadWorldsASync() {
return getConfig().getBoolean("load_worlds_async");
}
}

View File

@ -59,6 +59,9 @@ unloadingtime: 20
# Except for players with the permissions: ws.gamemode | ws.tp.*
survival: false
# If WorldSystem should load the worlds async if possible (FAWE installed)
load_worlds_async: true
# Options for the database saving player positions
database:
# Which type should be choosen: