geforkt von SteamWar/BungeeCore
Update ArenaCommand
Dieser Commit ist enthalten in:
Ursprung
93757ff86e
Commit
183248c0b1
@ -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
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren