geforkt von SteamWar/BungeeCore
Add BauLockState.TEAM_AND_SERVERTEAM and BauLockState.SERVERTEAM as requested by many
Dieser Commit ist enthalten in:
Ursprung
779d5f57dc
Commit
334afbac63
@ -22,6 +22,7 @@ package de.steamwar.bungeecore.util;
|
|||||||
import de.steamwar.bungeecore.Message;
|
import de.steamwar.bungeecore.Message;
|
||||||
import de.steamwar.sql.SteamwarUser;
|
import de.steamwar.sql.SteamwarUser;
|
||||||
import de.steamwar.sql.UserConfig;
|
import de.steamwar.sql.UserConfig;
|
||||||
|
import de.steamwar.sql.UserPerm;
|
||||||
import lombok.experimental.UtilityClass;
|
import lombok.experimental.UtilityClass;
|
||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
|
|
||||||
@ -43,6 +44,13 @@ public class BauLock {
|
|||||||
switch (state == null ? BauLockState.OPEN : BauLockState.valueOf(state)) {
|
switch (state == null ? BauLockState.OPEN : BauLockState.valueOf(state)) {
|
||||||
case NOBODY:
|
case NOBODY:
|
||||||
return true;
|
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:
|
case TEAM:
|
||||||
return owner.getTeam() != target.getTeam();
|
return owner.getTeam() != target.getTeam();
|
||||||
case OPEN:
|
case OPEN:
|
||||||
|
@ -22,6 +22,8 @@ package de.steamwar.bungeecore.util;
|
|||||||
public enum BauLockState {
|
public enum BauLockState {
|
||||||
|
|
||||||
NOBODY, // Locks the build server for all users
|
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
|
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
|
OPEN //unlocks the build server for all users
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren