SteamWar/BungeeCore
Archiviert
13
2

Merge pull request 'Add BauLockState.TEAM_AND_SERVERTEAM and BauLockState.SERVERTEAM as requested by many' (#504) from ExtendedBauLock into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Reviewed-on: #504
Reviewed-by: Lixfel <lixfel@steamwar.de>
Dieser Commit ist enthalten in:
Lixfel 2023-12-22 10:07:40 +01:00
Commit ed5f84dc20
4 geänderte Dateien mit 16 neuen und 2 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
}

Datei anzeigen

@ -210,8 +210,10 @@ BAU_ADDMEMBER_ADDED_TARGET=§aYou have been added to the world of §e{0}§a.
BAU_TP_USAGE=§8/§7build tp §8[§eplayer§8]
BAU_TP_NOALLOWED=§cYou are not allowed to teleport to this player's world.
BAU_LOCKED_NOALLOWED=§cThe build server is currently locked.
BAU_LOCKED_OPTIONS=§7Build server lock options§8: §cnobody§8, §eteam§8, §aopen
BAU_LOCKED_OPTIONS=§7Build server lock options§8: §cnobody§8, §eserverteam§8, §eteam_and_serverteam§8, §eteam§8, §aopen
BAU_LOCKED_NOBODY=§7You have locked your build server for all players.
BAU_LOCKED_SERVERTEAM=§7You've locked your build server for all players except added sever team members.
BAU_LOCKED_TEAM_AND_SERVERTEAM=§7You've locked your build server for all players except added team members and sever team members.
BAU_LOCKED_TEAM=§7You've locked your build server for all players except added team members.
BAU_LOCKED_OPEN=§7You have opened your build server for all added players.
BAU_DELMEMBER_USAGE=§8/§7build delmember §8[§eplayer§8]

Datei anzeigen

@ -193,8 +193,10 @@ BAU_ADDMEMBER_ADDED_TARGET=§aDu wurdest zu der Welt von §e{0} §ahinzugefügt.
BAU_TP_USAGE=§8/§7bau tp §8[§eSpieler§8]
BAU_TP_NOALLOWED=§cDu darfst dich nicht auf diese Welt teleportieren.
BAU_LOCKED_NOALLOWED=§cDer Bauserver ist momentan gesperrt.
BAU_LOCKED_OPTIONS=§7Bauserver-Sperroptionen§8: §cnobody§8, §eteam§8, §aopen
BAU_LOCKED_OPTIONS=§7Bauserver-Sperroptionen§8: §cnobody§8, §eserverteam§8, §eteam_and_serverteam§8, §eteam§8, §aopen
BAU_LOCKED_NOBODY=§7Du hast deinen Bau für alle Spieler geschlossen.
BAU_LOCKED_SERVERTEAM=§7Du hast deinen Bau für alle außer hinzugefügte Serverteammitglieder gesperrt.
BAU_LOCKED_TEAM_AND_SERVERTEAM=§7Du hast deinen Bau für alle außer hinzugefügte Teammitglieder und Serverteammitglieder gesperrt.
BAU_LOCKED_TEAM=§7Du hast deinen Bau für alle außer hinzugefügte Teammitglieder gesperrt.
BAU_LOCKED_OPEN=§7Du hast deinen Bau für alle hinzugefügten Spieler geöffnet.
BAU_DELMEMBER_USAGE=§8/§7bau delmember §8[§eSpieler§8]