mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2025-01-12 10:50:35 +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 java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
import static fr.xephi.authme.listener.ListenerService.shouldCancelEvent;
|
import static fr.xephi.authme.listener.ListenerService.shouldCancelEvent;
|
||||||
|
import org.bukkit.GameMode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Listener class for player's events
|
* Listener class for player's events
|
||||||
@ -192,6 +193,11 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Settings.isForceSurvivalModeEnabled
|
||||||
|
&& !player.hasPermission(PlayerPermission.BYPASS_FORCE_SURVIVAL.getNode())) {
|
||||||
|
player.setGameMode(GameMode.SURVIVAL);
|
||||||
|
}
|
||||||
|
|
||||||
String name = player.getName().toLowerCase();
|
String name = player.getName().toLowerCase();
|
||||||
String joinMsg = event.getJoinMessage();
|
String joinMsg = event.getJoinMessage();
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ public final class Settings {
|
|||||||
isSessionsEnabled, isAllowRestrictedIp,
|
isSessionsEnabled, isAllowRestrictedIp,
|
||||||
isMovementAllowed, isKickNonRegisteredEnabled,
|
isMovementAllowed, isKickNonRegisteredEnabled,
|
||||||
isForceSingleSessionEnabled, isForceSpawnLocOnJoinEnabled,
|
isForceSingleSessionEnabled, isForceSpawnLocOnJoinEnabled,
|
||||||
isSaveQuitLocationEnabled,
|
isSaveQuitLocationEnabled, isForceSurvivalModeEnabled,
|
||||||
isCachingEnabled,
|
isCachingEnabled,
|
||||||
isKickOnWrongPasswordEnabled, enablePasswordConfirmation,
|
isKickOnWrongPasswordEnabled, enablePasswordConfirmation,
|
||||||
protectInventoryBeforeLogInEnabled, isBackupActivated,
|
protectInventoryBeforeLogInEnabled, isBackupActivated,
|
||||||
|
@ -152,6 +152,9 @@ settings:
|
|||||||
noTeleport: false
|
noTeleport: false
|
||||||
# Regex syntax for allowed Chars in passwords.
|
# Regex syntax for allowed Chars in passwords.
|
||||||
allowedPasswordCharacters: '[\x21-\x7E]*'
|
allowedPasswordCharacters: '[\x21-\x7E]*'
|
||||||
|
GameMode:
|
||||||
|
# ForceSurvivalMode to player when join ?
|
||||||
|
ForceSurvivalMode: false
|
||||||
security:
|
security:
|
||||||
# minimum Length of password
|
# minimum Length of password
|
||||||
minPasswordLength: 5
|
minPasswordLength: 5
|
||||||
|
Loading…
Reference in New Issue
Block a user