Archiviert
1
0

Update ArenaCommand

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 @Register
public void arenaJoin(ProxiedPlayer player, ServerInfo server) { public void arenaJoin(ProxiedPlayer player, Subserver server) {
Subserver subserver = Subserver.getSubserver(server); TpCommand.teleport(player, server.getServer());
if(server == null || subserver == null || subserver.getType() != Servertype.ARENA) {
ChatSender.of(player).system("ARENA_NOT_FOUND");
return;
}
TpCommand.teleport(player, server);
} }
@ClassMapper(ServerInfo.class) @ClassMapper(value = ServerInfo.class, local = true)
public TypeMapper<ServerInfo> serverInfoTypeMapper() { public TypeMapper<Subserver> serverInfoTypeMapper() {
return new TypeMapper<ServerInfo>() { return new TypeMapper<Subserver>() {
@Override @Override
public ServerInfo map(CommandSender commandSender, String[] previousArguments, String s) { public Subserver map(CommandSender commandSender, String[] previousArguments, String s) {
return ProxyServer.getInstance().getServerInfo(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 @Override