remove speed option + config description enhancements

This commit is contained in:
Gabriele C
2015-09-20 13:41:06 +02:00
parent 23e16bb717
commit d826777701
7 changed files with 65 additions and 55 deletions
@@ -486,7 +486,7 @@ public class AdminCommand implements CommandExecutor {
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(sched.runTaskAsynchronously(plugin, new MessageTask(plugin, name, m.send("reg_msg"), interval)));
if (Settings.applyBlindEffect)
target.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, Settings.getRegistrationTimeout * 20, 2));
if (!Settings.isMovementAllowed) {
if (!Settings.isMovementAllowed && Settings.isRemoveSpeedEnabled) {
target.setWalkSpeed(0.0f);
target.setFlySpeed(0.0f);
}
@@ -109,7 +109,7 @@ public class UnregisterCommand implements CommandExecutor {
}
if (Settings.applyBlindEffect)
player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, Settings.getRegistrationTimeout * 20, 2));
if (!Settings.isMovementAllowed) {
if (!Settings.isMovementAllowed && Settings.isRemoveSpeedEnabled) {
player.setWalkSpeed(0.0f);
player.setFlySpeed(0.0f);
}
@@ -186,7 +186,7 @@ public class ProcessSyncronousPlayerLogin implements Runnable {
if (Settings.applyBlindEffect)
player.removePotionEffect(PotionEffectType.BLINDNESS);
if (!Settings.isMovementAllowed) {
if (!Settings.isMovementAllowed && Settings.isRemoveSpeedEnabled) {
player.setWalkSpeed(0.2f);
player.setFlySpeed(0.1f);
}
@@ -54,8 +54,10 @@ public class ProcessSyncronousPlayerLogout implements Runnable {
if (!Settings.isMovementAllowed) {
player.setAllowFlight(true);
player.setFlying(true);
player.setFlySpeed(0.0f);
player.setWalkSpeed(0.0f);
if (Settings.isRemoveSpeedEnabled) {
player.setFlySpeed(0.0f);
player.setWalkSpeed(0.0f);
}
}
// Player is now logout... Time to fire event !
Bukkit.getServer().getPluginManager().callEvent(new LogoutEvent(player));
@@ -116,7 +116,7 @@ public class ProcessSyncronousPasswordRegister implements Runnable {
}
if (Settings.applyBlindEffect)
player.removePotionEffect(PotionEffectType.BLINDNESS);
if (!Settings.isMovementAllowed) {
if (!Settings.isMovementAllowed && Settings.isRemoveSpeedEnabled) {
player.setWalkSpeed(0.2f);
player.setFlySpeed(0.1f);
}
@@ -67,7 +67,7 @@ public final class Settings extends YamlConfiguration {
enableProtection, enableAntiBot, recallEmail, useWelcomeMessage,
broadcastWelcomeMessage, forceRegKick, forceRegLogin,
checkVeryGames, delayJoinMessage, noTeleport, applyBlindEffect,
customAttributes, generateImage;
customAttributes, generateImage, isRemoveSpeedEnabled;
public static String getNickRegex, getUnloggedinGroup, getMySQLHost,
getMySQLPort, getMySQLUsername, getMySQLPassword, getMySQLDatabase,
@@ -136,6 +136,7 @@ public final class Settings extends YamlConfiguration {
isAllowRestrictedIp = configFile.getBoolean("settings.restrictions.AllowRestrictedUser", false);
getRestrictedIp = configFile.getStringList("settings.restrictions.AllowedRestrictedUser");
isMovementAllowed = configFile.getBoolean("settings.restrictions.allowMovement", false);
isRemoveSpeedEnabled = configFile.getBoolean("settings.restrictions.removeSpeed", true);
getMovementRadius = configFile.getInt("settings.restrictions.allowedMovementRadius", 100);
getJoinPermissions = configFile.getStringList("GroupOptions.Permissions.PermissionsOnJoin");
isKickOnWrongPasswordEnabled = configFile.getBoolean("settings.restrictions.kickOnWrongPassword", false);
@@ -225,7 +226,7 @@ public final class Settings extends YamlConfiguration {
getForcedWorlds = configFile.getStringList("settings.restrictions.ForceSpawnOnTheseWorlds");
banUnsafeIp = configFile.getBoolean("settings.restrictions.banUnsafedIP", false);
doubleEmailCheck = configFile.getBoolean("settings.registration.doubleEmailCheck", false);
sessionExpireOnIpChange = configFile.getBoolean("settings.sessions.sessionExpireOnIpChange", false);
sessionExpireOnIpChange = configFile.getBoolean("settings.sessions.sessionExpireOnIpChange", true);
useLogging = configFile.getBoolean("Security.console.logConsole", false);
disableSocialSpy = configFile.getBoolean("Hooks.disableSocialSpy", true);
bCryptLog2Rounds = configFile.getInt("ExternalBoardOptions.bCryptLog2Round", 10);
@@ -294,6 +295,10 @@ public final class Settings extends YamlConfiguration {
set("Protection.enableProtection", false);
changes = true;
}
if (!contains("settings.restrictions.removeSpeed")) {
set("settings.restrictions.removeSpeed", true);
changes = true;
}
if (!contains("DataSource.mySQLMaxConections")) {
set("DataSource.mySQLMaxConections", 25);
changes = true;