SteamWar/BungeeCore
Archiviert
13
2

CommandArena #373

Zusammengeführt
Lixfel hat 5 Commits von CommandArena nach master 2022-07-22 08:53:22 +02:00 zusammengeführt
Nur Änderungen aus Commit 183248c0b1 werden angezeigt - Alle Commits anzeigen

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;
}
TpCommand.teleport(player, server);
public void arenaJoin(ProxiedPlayer player, Subserver server) {
TpCommand.teleport(player, server.getServer());
}
@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