SteamWar/BungeeCore
Archiviert
13
2

Add BauLockState.TEAM_AND_SERVERTEAM and BauLockState.SERVERTEAM as requested by many #504

Zusammengeführt
Lixfel hat 2 Commits von ExtendedBauLock nach master 2023-12-22 10:07:41 +01:00 zusammengeführt
2 geänderte Dateien mit 10 neuen und 0 gelöschten Zeilen
Nur Änderungen aus Commit 334afbac63 werden angezeigt - Alle Commits anzeigen

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
}