Archiviert
1
0

Merge pull request 'Improve TpCommand for current checking players' (#356) from ImproveChecking into master

Reviewed-on: SteamWar/BungeeCore#356
Reviewed-by: Lixfel <lixfel@steamwar.de>
Dieser Commit ist enthalten in:
Lixfel 2022-05-24 09:06:39 +02:00
Commit d7f0d3300f
4 geänderte Dateien mit 17 neuen und 6 gelöschten Zeilen

1
.gitmodules vendored
Datei anzeigen

@ -1,3 +1,4 @@
[submodule "CommonCore"] [submodule "CommonCore"]
path = CommonCore path = CommonCore
url = https://steamwar.de/devlabs/SteamWar/CommonCore.git url = https://steamwar.de/devlabs/SteamWar/CommonCore.git
branch = master

@ -1 +1 @@
Subproject commit e83103d8afce8161a12d008d6ad99ba439243b27 Subproject commit 0f03b57e437c1d843816b7202d95b79ff0a8d2df

Datei anzeigen

@ -58,6 +58,10 @@ public class CheckCommand extends BasicCommand {
return currentCheckers.containsKey(player.getUniqueId()); return currentCheckers.containsKey(player.getUniqueId());
} }
public static SchematicNode getCheckingSchem(ProxiedPlayer player) {
return currentCheckers.get(player.getUniqueId()).schematic;
}
public CheckCommand() { public CheckCommand() {
super("check", ConnectionListener.CHECK_PERMISSION); super("check", ConnectionListener.CHECK_PERMISSION);

Datei anzeigen

@ -20,11 +20,9 @@
package de.steamwar.bungeecore.commands; package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.*; import de.steamwar.bungeecore.*;
import de.steamwar.bungeecore.sql.BauweltMember; import de.steamwar.bungeecore.sql.*;
import de.steamwar.bungeecore.sql.Event;
import de.steamwar.bungeecore.sql.Punishment;
import de.steamwar.bungeecore.sql.Team;
import de.steamwar.messages.ChatSender; import de.steamwar.messages.ChatSender;
import net.md_5.bungee.BungeeCord;
import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.config.ServerInfo; import net.md_5.bungee.api.config.ServerInfo;
@ -87,7 +85,15 @@ public class TpCommand extends BasicCommand {
} else if(subserver instanceof Bauserver) { } else if(subserver instanceof Bauserver) {
Bauserver bauserver = (Bauserver) subserver; Bauserver bauserver = (Bauserver) subserver;
if (bauserver.getOwner().equals(player.getUniqueId()) || BauweltMember.getBauMember(bauserver.getOwner(), player.getUniqueId()) != null) { ProxiedPlayer checker = BungeeCord.getInstance().getPlayer(bauserver.getOwner());
if (checker != null && CheckCommand.isChecking(checker)) {
SteamwarUser steamwarUser = SteamwarUser.get(player);
if (steamwarUser.getUserGroup().isCheckSchematics() || CheckCommand.getCheckingSchem(checker).getOwner() == steamwarUser.getId()) {
SubserverSystem.sendPlayer(subserver, player);
} else {
sender.system("JOIN_PLAYER_BLOCK");
}
} else if (bauserver.getOwner().equals(player.getUniqueId()) || BauweltMember.getBauMember(bauserver.getOwner(), player.getUniqueId()) != null) {
SubserverSystem.sendPlayer(subserver, player); SubserverSystem.sendPlayer(subserver, player);
} else { } else {
SubserverSystem.sendDeniedMessage(player, bauserver.getOwner()); SubserverSystem.sendDeniedMessage(player, bauserver.getOwner());