SteamWar/BungeeCore
Archiviert
13
2

Add BauLockState.TEAM_AND_SERVERTEAM and BauLockState.SERVERTEAM as requested by many
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2023-12-21 18:15:23 +01:00
Ursprung 779d5f57dc
Commit 334afbac63
2 geänderte Dateien mit 10 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -22,6 +22,7 @@ package de.steamwar.bungeecore.util;
import de.steamwar.bungeecore.Message;
import de.steamwar.sql.SteamwarUser;
import de.steamwar.sql.UserConfig;
import de.steamwar.sql.UserPerm;
import lombok.experimental.UtilityClass;
import net.md_5.bungee.api.connection.ProxiedPlayer;
@ -43,6 +44,13 @@ public class BauLock {
switch (state == null ? BauLockState.OPEN : BauLockState.valueOf(state)) {
case NOBODY:
return true;
case SERVERTEAM:
return !target.hasPerm(UserPerm.TEAM);
case TEAM_AND_SERVERTEAM:
if (target.hasPerm(UserPerm.TEAM)) {
return false;
}
return owner.getTeam() != target.getTeam();
case TEAM:
return owner.getTeam() != target.getTeam();
case OPEN:

Datei anzeigen

@ -22,6 +22,8 @@ package de.steamwar.bungeecore.util;
public enum BauLockState {
NOBODY, // Locks the build server for all users
SERVERTEAM, // opens the build server only for every added user which is a server team member
TEAM_AND_SERVERTEAM, //opens the build server only for every added user which is in the same team as the buildOwner and every server team member
TEAM, //opens the build server only for every added user which is in the same team as the buildOwner
OPEN //unlocks the build server for all users
}