From 334afbac6391963c210a88a5757a4501f72cd151 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Thu, 21 Dec 2023 18:15:23 +0100 Subject: [PATCH 1/2] Add BauLockState.TEAM_AND_SERVERTEAM and BauLockState.SERVERTEAM as requested by many --- src/de/steamwar/bungeecore/util/BauLock.java | 8 ++++++++ src/de/steamwar/bungeecore/util/BauLockState.java | 2 ++ 2 files changed, 10 insertions(+) diff --git a/src/de/steamwar/bungeecore/util/BauLock.java b/src/de/steamwar/bungeecore/util/BauLock.java index 43926dd..238650d 100644 --- a/src/de/steamwar/bungeecore/util/BauLock.java +++ b/src/de/steamwar/bungeecore/util/BauLock.java @@ -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: diff --git a/src/de/steamwar/bungeecore/util/BauLockState.java b/src/de/steamwar/bungeecore/util/BauLockState.java index a5626b1..c3fa564 100644 --- a/src/de/steamwar/bungeecore/util/BauLockState.java +++ b/src/de/steamwar/bungeecore/util/BauLockState.java @@ -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 } From c72a042bbb30fd6bdf8f98cd9999c88386391ad6 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Thu, 21 Dec 2023 19:20:14 +0100 Subject: [PATCH 2/2] Add translations --- src/de/steamwar/messages/BungeeCore.properties | 4 +++- src/de/steamwar/messages/BungeeCore_de.properties | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index 0575535..13976d1 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -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] diff --git a/src/de/steamwar/messages/BungeeCore_de.properties b/src/de/steamwar/messages/BungeeCore_de.properties index 7e5566a..9274e24 100644 --- a/src/de/steamwar/messages/BungeeCore_de.properties +++ b/src/de/steamwar/messages/BungeeCore_de.properties @@ -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]