diff --git a/src/de/steamwar/bungeecore/commands/CheckCommand.java b/src/de/steamwar/bungeecore/commands/CheckCommand.java index b2aee641..eedde0fc 100644 --- a/src/de/steamwar/bungeecore/commands/CheckCommand.java +++ b/src/de/steamwar/bungeecore/commands/CheckCommand.java @@ -22,10 +22,7 @@ package de.steamwar.bungeecore.commands; import de.steamwar.bungeecore.*; import de.steamwar.bungeecore.bot.util.DiscordSchemAlert; import de.steamwar.bungeecore.listeners.ConnectionListener; -import de.steamwar.sql.CheckedSchematic; -import de.steamwar.sql.SchematicNode; -import de.steamwar.sql.SchematicType; -import de.steamwar.sql.SteamwarUser; +import de.steamwar.sql.*; import de.steamwar.command.SWCommand; import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.ProxyServer; @@ -117,15 +114,21 @@ public class CheckCommand extends SWCommand { return; } + SteamwarUser checkingUser = SteamwarUser.get(player.getUniqueId()); SchematicNode schem = SchematicNode.getSchematicNode(Integer.parseInt(schemID)); if(!schem.getSchemtype().check()){ ProxyServer.getInstance().getLogger().log(Level.SEVERE, player.getName() + " tried to check an uncheckable schematic!"); return; - }else if(schem.getOwner() == SteamwarUser.get(player.getUniqueId()).getId()) { + }else if(schem.getOwner() == checkingUser.getId()) { Message.send("CHECK_SCHEMATIC_OWN", player); return; } + int playerTeam = checkingUser.hasPerm(UserPerm.MODERATION) ? 0 : checkingUser.getTeam(); + if (playerTeam != 0 && SteamwarUser.get(schem.getOwner()).getTeam() == playerTeam) { + Message.send("CHECK_SCHEMATIC_OWN_TEAM", player); + return; + } new CheckSession(player, schem); } diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index c0388092..05755350 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -293,6 +293,7 @@ CHECK_LIST_CHECKING={0} §8{1} §7{2} §e{3} §7is being reviewed by §e{4} CHECK_LIST_CHECKING_HOVER=§eTo the reviewer CHECK_SCHEMATIC_ALREADY_CHECKING=§cYou are already reviewing a schematic! CHECK_SCHEMATIC_OWN=§cYou cannot review your own schematics. +CHECK_SCHEMATIC_OWN_TEAM=§cYou cannot review your team schematics. CHECK_SCHEMATIC_PREVIOUS=§7{0} from {1}§8: §e{2} CHECK_INVALID_RANK=§cUnknown schematic rank. CHECK_ABORT=§aThe test operation was canceled! diff --git a/src/de/steamwar/messages/BungeeCore_de.properties b/src/de/steamwar/messages/BungeeCore_de.properties index e396bdba..7e5566a3 100644 --- a/src/de/steamwar/messages/BungeeCore_de.properties +++ b/src/de/steamwar/messages/BungeeCore_de.properties @@ -276,6 +276,7 @@ CHECK_LIST_CHECKING={0} §8{1} §7{2} §e{3} §7wird geprüft von §e{4} CHECK_LIST_CHECKING_HOVER=§eZum Prüfer CHECK_SCHEMATIC_ALREADY_CHECKING=§cDu prüfst schon eine Schematic! CHECK_SCHEMATIC_OWN=§cDu kannst nicht deine eigenen Schematics prüfen. +CHECK_SCHEMATIC_OWN_TEAM=§cDu kannst nicht Schematics deines Teams prüfen. CHECK_SCHEMATIC_PREVIOUS=§7{0} von {1}§8: §e{2} CHECK_INVALID_RANK=§cUnbekannter Schematicrang. CHECK_ABORT=§aDer Prüfvorgang wurde abgebrochen!