SteamWar/BungeeCore
Archiviert
13
2

Update ArenaCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2022-07-17 20:38:59 +02:00
Ursprung 93757ff86e
Commit 183248c0b1

Datei anzeigen

@ -39,22 +39,25 @@ public class ArenaCommand extends SWCommand {
}
@Register
public void arenaJoin(ProxiedPlayer player, ServerInfo server) {
Subserver subserver = Subserver.getSubserver(server);
if(server == null || subserver == null || subserver.getType() != Servertype.ARENA) {
ChatSender.of(player).system("ARENA_NOT_FOUND");
return;
public void arenaJoin(ProxiedPlayer player, Subserver server) {
TpCommand.teleport(player, server.getServer());
}
TpCommand.teleport(player, server);
}
@ClassMapper(ServerInfo.class)
public TypeMapper<ServerInfo> serverInfoTypeMapper() {
return new TypeMapper<ServerInfo>() {
@ClassMapper(value = ServerInfo.class, local = true)
public TypeMapper<Subserver> serverInfoTypeMapper() {
return new TypeMapper<Subserver>() {
@Override
public ServerInfo map(CommandSender commandSender, String[] previousArguments, String s) {
return ProxyServer.getInstance().getServerInfo(s);
public Subserver map(CommandSender commandSender, String[] previousArguments, String s) {
return Subserver.getSubserver(ProxyServer.getInstance().getServerInfo(s));
}
@Override
public boolean validate(CommandSender sender, Subserver value, MessageSender messageSender) {
if (value == null || value.getType() != Servertype.ARENA) {
messageSender.send("ARENA_NOT_FOUND");
return false;
}
return true;
}
@Override