SteamWar/BungeeCore
Archiviert
13
2

Add RankedCommand MultiLang & Multiple Bug Fixes

Dieser Commit ist enthalten in:
Chaoscaot 2021-01-19 01:37:01 +01:00
Ursprung f80829fc46
Commit 33c45dd3f2
7 geänderte Dateien mit 26 neuen und 21 gelöschten Zeilen

Datei anzeigen

@ -103,7 +103,7 @@ public class Message {
public static void broadcast(String message, boolean prefixed, String onHover, ClickEvent onClick, Object... params){ public static void broadcast(String message, boolean prefixed, String onHover, ClickEvent onClick, Object... params){
for(ProxiedPlayer player : ProxyServer.getInstance().getPlayers()) for(ProxiedPlayer player : ProxyServer.getInstance().getPlayers())
send(message, player, parse(onHover, prefixed, player), onClick, params); send(message, player, parse(onHover, prefixed, player, params), onClick, params);
} }
public static void broadcast(String message, String onHover, ClickEvent onClick, Object... params){ public static void broadcast(String message, String onHover, ClickEvent onClick, Object... params){

Datei anzeigen

@ -80,7 +80,7 @@ public class ChallengeCommand extends BasicCommand {
arena.sendPlayer(player); arena.sendPlayer(player);
arena.sendPlayer(target); arena.sendPlayer(target);
Message.broadcast("CHALLENGE_BROADCAST", sender, true, Message.parse("CHALLENGE_BROADCAST_HOVER", player), //TODO Needs BanSystemRework for Loading from Message File Message.broadcast("CHALLENGE_BROADCAST", sender, true, "CHALLENGE_BROADCAST_HOVER",
new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + player.getName()), mode.getDisplayName(), player.getDisplayName(), target.getDisplayName()); new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + player.getName()), mode.getDisplayName(), player.getDisplayName(), target.getDisplayName());
}else{ }else{
if(!challenges.containsKey(player)){ if(!challenges.containsKey(player)){

Datei anzeigen

@ -166,7 +166,7 @@ public class FightCommand extends BasicCommand {
createArena(sender, "/fight ", args, 0, false, (player, mode, map) -> { createArena(sender, "/fight ", args, 0, false, (player, mode, map) -> {
Subserver arena = SubserverSystem.startArena(mode, map, 0, 0, null, null, player.getUniqueId(), null); Subserver arena = SubserverSystem.startArena(mode, map, 0, 0, null, null, player.getUniqueId(), null);
arena.sendPlayer(player); arena.sendPlayer(player);
Message.broadcast("FIGHT_BROADCAST", true, Message.parse("FIGHT_BROADCAST_HOVER", player, player.getName()) //TODO Needs Message Object Message.broadcast("FIGHT_BROADCAST", true, "FIGHT_BROADCAST_HOVER"
, new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + player.getName()), mode.getDisplayName(), player.getName()); , new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + player.getName()), mode.getDisplayName(), player.getName());
}); });
} }

Datei anzeigen

@ -35,7 +35,7 @@ public class HistoricCommand extends BasicCommand {
FightCommand.createArena(sender, "/historic ", args, 0, true, (player, mode, map) -> { FightCommand.createArena(sender, "/historic ", args, 0, true, (player, mode, map) -> {
Subserver arena = SubserverSystem.startArena(mode, map, 0, 0, null, null, player.getUniqueId(), null); Subserver arena = SubserverSystem.startArena(mode, map, 0, 0, null, null, player.getUniqueId(), null);
arena.sendPlayer(player); arena.sendPlayer(player);
Message.broadcast("HISTORIC_BROADCAST", true, Message.parse("HISTORIC_BROADCAST_HOVER", player, player.getName()) //TODO Needs Message Object Message.broadcast("HISTORIC_BROADCAST", true, "HISTORIC_BROADCAST_HOVER"
, new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + player.getName()), mode.getDisplayName(), player.getName()); , new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + player.getName()), mode.getDisplayName(), player.getName());
}); });
} }

Datei anzeigen

@ -24,9 +24,6 @@ import de.steamwar.bungeecore.sql.BauweltMember;
import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.chat.ClickEvent; import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.chat.ComponentBuilder;
import net.md_5.bungee.api.chat.HoverEvent;
import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.config.ServerInfo; import net.md_5.bungee.api.config.ServerInfo;
import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.api.connection.ProxiedPlayer;
@ -44,7 +41,7 @@ public class JoinmeCommand extends BasicCommand {
ProxiedPlayer player = (ProxiedPlayer) sender; ProxiedPlayer player = (ProxiedPlayer) sender;
if (args.length == 0 && player.hasPermission("bungeecore.joinme")) { if (args.length == 0 && player.hasPermission("bungeecore.joinme")) {
Message.broadcast("JOINME_BROADCAST", true, Message.parse("JOINME_BROADCAST_HOVER", player) //TODO Needs Message Object Message.broadcast("JOINME_BROADCAST", true, "JOINME_BROADCAST_HOVER"
, new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + player.getName())); , new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + player.getName()));
} else if (args.length == 1) { } else if (args.length == 1) {
ProxiedPlayer target = ProxyServer.getInstance().getPlayer(args[0]); ProxiedPlayer target = ProxyServer.getInstance().getPlayer(args[0]);

Datei anzeigen

@ -59,7 +59,7 @@ public class RankedCommand extends BasicCommand {
if(mode == null) if(mode == null)
return; return;
else if(!mode.isRanked()){ else if(!mode.isRanked()){
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§cDieser Spielmodus ist nicht für Ranglistenspiele freigeschalten"); Message.send("RANKED_NO_RANKED_MODE", sender);
return; return;
} }
@ -114,14 +114,14 @@ public class RankedCommand extends BasicCommand {
private void togglePlayer(ProxiedPlayer player){ private void togglePlayer(ProxiedPlayer player){
for(WaitingPlayer wp : players){ for(WaitingPlayer wp : players){
if(wp.player == player){ if(wp.player == player){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cRanglistenspiel-Warteschlange verlassen"); Message.send("RANKED_QUEUE_LEFT", player);
players.remove(wp); players.remove(wp);
return; return;
} }
} }
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§aRanglistenspiel-Warteschlange betreten"); Message.send("RANKED_QUEUE_JOINED", player);
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§7Wiederhole den Befehl zum Verlassen der Warteschlange"); Message.send("RANKED_QUEUE_HOW_TO_LEAVE", player);
players.add(new WaitingPlayer(player, mode.getSchemType())); players.add(new WaitingPlayer(player, mode.getSchemType()));
} }
@ -160,8 +160,8 @@ public class RankedCommand extends BasicCommand {
for(Map.Entry<WaitingPlayer, WaitingPlayer> entry : inRange.entrySet()){ for(Map.Entry<WaitingPlayer, WaitingPlayer> entry : inRange.entrySet()){
WaitingPlayer wp1 = entry.getKey(); WaitingPlayer wp1 = entry.getKey();
WaitingPlayer wp2 = entry.getValue(); WaitingPlayer wp2 = entry.getValue();
BungeeCore.send(wp1.player, BungeeCore.CHAT_PREFIX + "§eGegner gefunden! Ranglistenspiel startet."); Message.send("RANKED_ENEMY_SPOTTED", wp1.player);
BungeeCore.send(wp2.player, BungeeCore.CHAT_PREFIX + "§eGegner gefunden! Ranglistenspiel startet."); Message.send("RANKED_ENEMY_SPOTTED", wp2.player);
removeFromAll(wp1.player); removeFromAll(wp1.player);
removeFromAll(wp2.player); removeFromAll(wp2.player);
@ -169,9 +169,8 @@ public class RankedCommand extends BasicCommand {
arena.sendPlayer(wp1.player); arena.sendPlayer(wp1.player);
arena.sendPlayer(wp2.player); arena.sendPlayer(wp2.player);
BungeeCore.broadcast(BungeeCore.CHAT_PREFIX + "§7" + mode.getDisplayName() + "§8-§7Ranglistenspiel§8: §e" + wp1.player.getName() + " vs " + wp2.player.getName(), Message.broadcast("RANKED_BROADCAST", true, "RANKED_BROADCAST_HOVER",
"§aZuschauen", new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + wp1.player.getName()), mode.getDisplayName(), wp1.player.getName(), wp2.player.getName());
new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + wp1.player.getName()));
} }
} }
} }
@ -204,7 +203,7 @@ public class RankedCommand extends BasicCommand {
if(subserver == null) if(subserver == null)
return true; return true;
if(subserver.getType() == Servertype.ARENA){ if(subserver.getType() == Servertype.ARENA){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cRanglistenspiel-Warteschlange verlassen"); Message.send("RANKED_QUEUE_LEFT", player);
return false; return false;
} }

Datei anzeigen

@ -182,7 +182,7 @@ FIGHT_UNKNOWN_ARENA=§cDie gewünschte Arena gibt es nicht.
FIGHT_ARENA_RANDOM=Random FIGHT_ARENA_RANDOM=Random
FIGHT_IN_ARENA=§cDu befindest dich bereits in einer Arena. FIGHT_IN_ARENA=§cDu befindest dich bereits in einer Arena.
FIGHT_BROADCAST=§7Klicke §ehier§7, um §e{0} §7gegen §e{1} §7zu §7kämpfen! FIGHT_BROADCAST=§7Klicke §ehier§7, um §e{0} §7gegen §e{1} §7zu §7kämpfen!
FIGHT_BROADCAST_HOVER=§aGegen §7{0} §ekämpfen FIGHT_BROADCAST_HOVER=§aGegen §7{1} §ekämpfen
#CheckCommand #CheckCommand
CHECK_REMINDER=§7Es sind §e{0} §7Schematics zu prüfen§8! CHECK_REMINDER=§7Es sind §e{0} §7Schematics zu prüfen§8!
@ -213,7 +213,7 @@ CHECK_DECLINED_TEAM=§7Die Schematic §e{0} §7von §e{1} §awurde aufgrund von
#HistoricCommand #HistoricCommand
HISTORIC_BROADCAST=§7Historischer §e{0}§8-§7Kampf von §e{1}§8! HISTORIC_BROADCAST=§7Historischer §e{0}§8-§7Kampf von §e{1}§8!
HISTORIC_BROADCAST_HOVER=§aGegen §7{0} §ekämpfen HISTORIC_BROADCAST_HOVER=§aGegen §7{1} §ekämpfen
#JoinmeCommand #JoinmeCommand
JOINME_SYNTAX=§7Mit §8/§ejoin §8[§eSpieler§8] §7kannst du einem Spieler folgen §8(z.B. in eine Arena)§7. JOINME_SYNTAX=§7Mit §8/§ejoin §8[§eSpieler§8] §7kannst du einem Spieler folgen §8(z.B. in eine Arena)§7.
@ -248,4 +248,13 @@ POLL_ANSWER_NEW=§aDeine Antwort wurde registriert
#RankCommand #RankCommand
RANK_HEADER=§7§lPlatzierungen RANK_HEADER=§7§lPlatzierungen
RANK_UNPLACED=§7{0}§8: §eunplatziert RANK_UNPLACED=§7{0}§8: §eunplatziert
RANK_PLACED=§7{0}§8: §e{1}§8. §7mit §e{2} §7Elo§8. RANK_PLACED=§7{0}§8: §e{1}§8. §7mit §e{2} §7Elo§8.
#RankedCommand
RANKED_NO_RANKED_MODE=§cDieser Spielmodus ist nicht für Ranglistenspiele freigeschalten
RANKED_QUEUE_JOINED=§aRanglistenspiel-Warteschlange betreten
RANKED_QUEUE_HOW_TO_LEAVE=§7Wiederhole den Befehl zum Verlassen der Warteschlange
RANKED_QUEUE_LEFT=§cRanglistenspiel-Warteschlange verlassen
RANKED_ENEMY_SPOTTED=§eGegner gefunden! Ranglistenspiel startet.
RANKED_BROADCAST=§7{0}§8-§7Ranglistenspiel§8: §e{1} vs {2}
RANKED_BROADCAST_HOVER=§aZuschauen