From 0ea95fb93c5b8408d6cb34c8de381dbce06060d5 Mon Sep 17 00:00:00 2001 From: NoChanceSD Date: Tue, 3 May 2016 16:36:05 +0100 Subject: [PATCH] Simplify force spawn location settings by grouping them Also, seems to work fine. Closes https://github.com/Xephi/AuthMeReloaded/issues/256 --- .../fr/xephi/authme/settings/Settings.java | 2 +- .../properties/RestrictionSettings.java | 6 ++--- src/main/resources/config.yml | 25 ++++++++++--------- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/main/java/fr/xephi/authme/settings/Settings.java b/src/main/java/fr/xephi/authme/settings/Settings.java index 944f675d9..0b6d719f8 100644 --- a/src/main/java/fr/xephi/authme/settings/Settings.java +++ b/src/main/java/fr/xephi/authme/settings/Settings.java @@ -102,7 +102,7 @@ public final class Settings { captchaLength = configFile.getInt("Security.captcha.captchaLength", 5); multiverse = load(HooksSettings.MULTIVERSE); bungee = load(HooksSettings.BUNGEECORD); - getForcedWorlds = configFile.getStringList("settings.restrictions.ForceSpawnOnTheseWorlds"); + getForcedWorlds = load(RestrictionSettings.FORCE_SPAWN_ON_WORLDS); defaultWorld = configFile.getString("Purge.defaultWorld", "world"); enableProtection = configFile.getBoolean("Protection.enableProtection", false); countries = configFile.getStringList("Protection.countries"); diff --git a/src/main/java/fr/xephi/authme/settings/properties/RestrictionSettings.java b/src/main/java/fr/xephi/authme/settings/properties/RestrictionSettings.java index 134f9e172..592e244c5 100644 --- a/src/main/java/fr/xephi/authme/settings/properties/RestrictionSettings.java +++ b/src/main/java/fr/xephi/authme/settings/properties/RestrictionSettings.java @@ -61,7 +61,7 @@ public class RestrictionSettings implements SettingsClass { "This is different from \"teleportUnAuthedToSpawn\" that teleport player", "back to his quit location after the authentication."}) public static final Property FORCE_SPAWN_LOCATION_AFTER_LOGIN = - newProperty("settings.restrictions.ForceSpawnLocOnJoinEnabled", false); + newProperty("settings.restrictions.ForceSpawnLocOnJoin.enabled", false); @Comment("This option will save the quit location of the players.") public static final Property SAVE_QUIT_LOCATION = @@ -150,10 +150,10 @@ public class RestrictionSettings implements SettingsClass { newProperty("settings.restrictions.displayOtherAccounts", true); @Comment({ - "WorldNames where we need to force the spawn location for ForceSpawnLocOnJoinEnabled", + "WorldNames where we need to force the spawn location", "Case-sensitive!"}) public static final Property> FORCE_SPAWN_ON_WORLDS = - newListProperty("settings.restrictions.ForceSpawnOnTheseWorlds", + newListProperty("settings.restrictions.ForceSpawnLocOnJoin.worlds", "world", "world_nether", "world_the_end"); @Comment("Ban ip when the ip is not the ip registered in database") diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 17b62b370..b76401088 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -88,12 +88,19 @@ settings: # due to "Logged in from another Location" # This setting will prevent potetial security exploits. ForceSingleSession: true - # If enabled, every player will be teleported to the world spawnpoint - # after successful authentication. - # The quit location of the player will be overwritten. - # This is different from "teleportUnAuthedToSpawn" that teleport player - # back to his quit location after the authentication. - ForceSpawnLocOnJoinEnabled: false + ForceSpawnLocOnJoin: + # If enabled, every player will be teleported to the world spawnpoint + # after successful authentication. + # The quit location of the player will be overwritten. + # This is different from "teleportUnAuthedToSpawn" that teleport player + # back to his quit location after the authentication. + enabled: false + # WorldNames where we need to force the spawn location + # Case-sensitive! + worlds: + - 'world' + - 'world_nether' + - 'world_the_end' # This option will save the quit location of the players. SaveQuitLocation: false # To activate the restricted user feature you need @@ -143,12 +150,6 @@ settings: # Should we display all other accounts from a player when he joins? # permission: /authme.admin.accounts displayOtherAccounts: true - # WorldNames where we need to force the spawn location for ForceSpawnLocOnJoinEnabled - # CASE SENSITIVE - ForceSpawnOnTheseWorlds: - - world - - world_nether - - world_the_end # Ban ip when the ip is not the ip registered in database banUnsafedIP: false # Spawn Priority, Values : authme, essentials, multiverse, default