Re add force survival gamemode option on join

This commit is contained in:
games647 2015-12-23 16:03:37 +01:00
parent da84efe090
commit 0beb937b8f
3 changed files with 10 additions and 1 deletions

View File

@ -49,6 +49,7 @@ import org.bukkit.event.player.PlayerShearEntityEvent;
import java.util.concurrent.ConcurrentHashMap;
import static fr.xephi.authme.listener.ListenerService.shouldCancelEvent;
import org.bukkit.GameMode;
/**
* Listener class for player's events
@ -192,6 +193,11 @@ public class AuthMePlayerListener implements Listener {
return;
}
if (Settings.isForceSurvivalModeEnabled
&& !player.hasPermission(PlayerPermission.BYPASS_FORCE_SURVIVAL.getNode())) {
player.setGameMode(GameMode.SURVIVAL);
}
String name = player.getName().toLowerCase();
String joinMsg = event.getJoinMessage();

View File

@ -65,7 +65,7 @@ public final class Settings {
isSessionsEnabled, isAllowRestrictedIp,
isMovementAllowed, isKickNonRegisteredEnabled,
isForceSingleSessionEnabled, isForceSpawnLocOnJoinEnabled,
isSaveQuitLocationEnabled,
isSaveQuitLocationEnabled, isForceSurvivalModeEnabled,
isCachingEnabled,
isKickOnWrongPasswordEnabled, enablePasswordConfirmation,
protectInventoryBeforeLogInEnabled, isBackupActivated,

View File

@ -152,6 +152,9 @@ settings:
noTeleport: false
# Regex syntax for allowed Chars in passwords.
allowedPasswordCharacters: '[\x21-\x7E]*'
GameMode:
# ForceSurvivalMode to player when join ?
ForceSurvivalMode: false
security:
# minimum Length of password
minPasswordLength: 5