mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-12-24 17:47:38 +01:00
Re add force survival gamemode option on join
This commit is contained in:
parent
da84efe090
commit
0beb937b8f
@ -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();
|
||||
|
||||
|
@ -65,7 +65,7 @@ public final class Settings {
|
||||
isSessionsEnabled, isAllowRestrictedIp,
|
||||
isMovementAllowed, isKickNonRegisteredEnabled,
|
||||
isForceSingleSessionEnabled, isForceSpawnLocOnJoinEnabled,
|
||||
isSaveQuitLocationEnabled,
|
||||
isSaveQuitLocationEnabled, isForceSurvivalModeEnabled,
|
||||
isCachingEnabled,
|
||||
isKickOnWrongPasswordEnabled, enablePasswordConfirmation,
|
||||
protectInventoryBeforeLogInEnabled, isBackupActivated,
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user