Simplify force spawn location settings by grouping them

Also, seems to work fine. Closes https://github.com/Xephi/AuthMeReloaded/issues/256
This commit is contained in:
NoChanceSD 2016-05-03 16:36:05 +01:00
parent 2a423e6f2f
commit 0ea95fb93c
3 changed files with 17 additions and 16 deletions

View File

@ -102,7 +102,7 @@ public final class Settings {
captchaLength = configFile.getInt("Security.captcha.captchaLength", 5); captchaLength = configFile.getInt("Security.captcha.captchaLength", 5);
multiverse = load(HooksSettings.MULTIVERSE); multiverse = load(HooksSettings.MULTIVERSE);
bungee = load(HooksSettings.BUNGEECORD); bungee = load(HooksSettings.BUNGEECORD);
getForcedWorlds = configFile.getStringList("settings.restrictions.ForceSpawnOnTheseWorlds"); getForcedWorlds = load(RestrictionSettings.FORCE_SPAWN_ON_WORLDS);
defaultWorld = configFile.getString("Purge.defaultWorld", "world"); defaultWorld = configFile.getString("Purge.defaultWorld", "world");
enableProtection = configFile.getBoolean("Protection.enableProtection", false); enableProtection = configFile.getBoolean("Protection.enableProtection", false);
countries = configFile.getStringList("Protection.countries"); countries = configFile.getStringList("Protection.countries");

View File

@ -61,7 +61,7 @@ public class RestrictionSettings implements SettingsClass {
"This is different from \"teleportUnAuthedToSpawn\" that teleport player", "This is different from \"teleportUnAuthedToSpawn\" that teleport player",
"back to his quit location after the authentication."}) "back to his quit location after the authentication."})
public static final Property<Boolean> FORCE_SPAWN_LOCATION_AFTER_LOGIN = public static final Property<Boolean> 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.") @Comment("This option will save the quit location of the players.")
public static final Property<Boolean> SAVE_QUIT_LOCATION = public static final Property<Boolean> SAVE_QUIT_LOCATION =
@ -150,10 +150,10 @@ public class RestrictionSettings implements SettingsClass {
newProperty("settings.restrictions.displayOtherAccounts", true); newProperty("settings.restrictions.displayOtherAccounts", true);
@Comment({ @Comment({
"WorldNames where we need to force the spawn location for ForceSpawnLocOnJoinEnabled", "WorldNames where we need to force the spawn location",
"Case-sensitive!"}) "Case-sensitive!"})
public static final Property<List<String>> FORCE_SPAWN_ON_WORLDS = public static final Property<List<String>> FORCE_SPAWN_ON_WORLDS =
newListProperty("settings.restrictions.ForceSpawnOnTheseWorlds", newListProperty("settings.restrictions.ForceSpawnLocOnJoin.worlds",
"world", "world_nether", "world_the_end"); "world", "world_nether", "world_the_end");
@Comment("Ban ip when the ip is not the ip registered in database") @Comment("Ban ip when the ip is not the ip registered in database")

View File

@ -88,12 +88,19 @@ settings:
# due to "Logged in from another Location" # due to "Logged in from another Location"
# This setting will prevent potetial security exploits. # This setting will prevent potetial security exploits.
ForceSingleSession: true ForceSingleSession: true
# If enabled, every player will be teleported to the world spawnpoint ForceSpawnLocOnJoin:
# after successful authentication. # If enabled, every player will be teleported to the world spawnpoint
# The quit location of the player will be overwritten. # after successful authentication.
# This is different from "teleportUnAuthedToSpawn" that teleport player # The quit location of the player will be overwritten.
# back to his quit location after the authentication. # This is different from "teleportUnAuthedToSpawn" that teleport player
ForceSpawnLocOnJoinEnabled: false # 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. # This option will save the quit location of the players.
SaveQuitLocation: false SaveQuitLocation: false
# To activate the restricted user feature you need # 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? # Should we display all other accounts from a player when he joins?
# permission: /authme.admin.accounts # permission: /authme.admin.accounts
displayOtherAccounts: true 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 # Ban ip when the ip is not the ip registered in database
banUnsafedIP: false banUnsafedIP: false
# Spawn Priority, Values : authme, essentials, multiverse, default # Spawn Priority, Values : authme, essentials, multiverse, default