geforkt von SteamWar/BungeeCore
Merge pull request 'Arena command' (#296) from arenaCommand into master
Reviewed-on: SteamWar/BungeeCore#296 Reviewed-by: YoyoNow <jwsteam@nidido.de>
Dieser Commit ist enthalten in:
Commit
ddcb5e652e
@ -127,6 +127,7 @@ public class BungeeCore extends Plugin {
|
||||
new ReplayCommand();
|
||||
new GDPRQuery();
|
||||
new PlaytimeCommand();
|
||||
new ArenaCommand();
|
||||
|
||||
// Punishment Commands:
|
||||
new PunishmentCommand("ban", Punishment.PunishmentType.Ban);
|
||||
|
56
src/de/steamwar/bungeecore/commands/ArenaCommand.java
Normale Datei
56
src/de/steamwar/bungeecore/commands/ArenaCommand.java
Normale Datei
@ -0,0 +1,56 @@
|
||||
/*
|
||||
This file is a part of the SteamWar software.
|
||||
|
||||
Copyright (C) 2020 SteamWar.de-Serverteam
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package de.steamwar.bungeecore.commands;
|
||||
|
||||
import de.steamwar.bungeecore.Message;
|
||||
import de.steamwar.bungeecore.Servertype;
|
||||
import de.steamwar.bungeecore.Subserver;
|
||||
import net.md_5.bungee.api.CommandSender;
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
import net.md_5.bungee.api.config.ServerInfo;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
|
||||
public class ArenaCommand extends BasicCommand {
|
||||
|
||||
public ArenaCommand() {
|
||||
super("arena", null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!(sender instanceof ProxiedPlayer))
|
||||
return;
|
||||
ProxiedPlayer player = (ProxiedPlayer) sender;
|
||||
|
||||
ServerInfo server = ProxyServer.getInstance().getServerInfo(String.join(" ", args));
|
||||
if(server == null) {
|
||||
Message.send("ARENA_NOT_FOUND", player);
|
||||
return;
|
||||
}
|
||||
|
||||
Subserver subserver = Subserver.getSubserver(server);
|
||||
if(subserver.getType() != Servertype.ARENA) {
|
||||
Message.send("ARENA_NOT_FOUND", player);
|
||||
return;
|
||||
}
|
||||
|
||||
subserver.sendPlayer(player);
|
||||
}
|
||||
}
|
@ -82,7 +82,7 @@ public class ChallengeCommand extends BasicCommand {
|
||||
arena.sendPlayer(target);
|
||||
|
||||
Message.broadcast("CHALLENGE_BROADCAST", "CHALLENGE_BROADCAST_HOVER",
|
||||
new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + player.getName()), mode.getDisplayName(), player.getName(), target.getName());
|
||||
new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/arena " + arena.getServer().getName()), mode.getDisplayName(), player.getName(), target.getName());
|
||||
}else{
|
||||
if(!challenges.containsKey(player)){
|
||||
challenges.put(player, new LinkedList<>());
|
||||
|
@ -167,7 +167,7 @@ public class FightCommand extends BasicCommand {
|
||||
Subserver arena = SubserverSystem.startArena(mode, map, 0, 0, 0, 0, null, null, player.getUniqueId(), null, false);
|
||||
arena.sendPlayer(player);
|
||||
Message.broadcast("FIGHT_BROADCAST", "FIGHT_BROADCAST_HOVER"
|
||||
, new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + player.getName()), mode.getDisplayName(), player.getName());
|
||||
, new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/arena " + arena.getServer().getName()), mode.getDisplayName(), player.getName());
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ public class HistoricCommand extends BasicCommand {
|
||||
Subserver arena = SubserverSystem.startArena(mode, map, 0, 0, 0, 0, null, null, player.getUniqueId(), null, false);
|
||||
arena.sendPlayer(player);
|
||||
Message.broadcast("HISTORIC_BROADCAST", "HISTORIC_BROADCAST_HOVER"
|
||||
, new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + player.getName()), mode.getDisplayName(), player.getName());
|
||||
, new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/arena " + arena.getServer().getName()), mode.getDisplayName(), player.getName());
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -173,7 +173,7 @@ public class RankedCommand extends BasicCommand {
|
||||
arena.sendPlayer(wp2.player);
|
||||
|
||||
Message.broadcast("RANKED_BROADCAST", "RANKED_BROADCAST_HOVER",
|
||||
new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + wp1.player.getName()), mode.getDisplayName(), wp1.player.getName(), wp2.player.getName());
|
||||
new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/arena " + arena.getServer().getName()), mode.getDisplayName(), wp1.player.getName(), wp2.player.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -571,4 +571,7 @@ GDPR_STATUS_LOGS=§7Suche und packe logs...
|
||||
GDPR_STATUS_FINISHED=§7Packen abgeschlossen
|
||||
|
||||
#Playtime Command
|
||||
HOURS_PLAYED=§7Deine Spielzeit beträgt§8: §e{0}h
|
||||
HOURS_PLAYED=§7Deine Spielzeit beträgt§8: §e{0}h
|
||||
|
||||
#Arena command
|
||||
ARENA_NOT_FOUND=§cDie angegebene Arena konnte nicht gefunden werden
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren