diff --git a/src/de/steamwar/bungeecore/commands/EventCommand.java b/src/de/steamwar/bungeecore/commands/EventCommand.java index 6e4b8e5..a81d075 100644 --- a/src/de/steamwar/bungeecore/commands/EventCommand.java +++ b/src/de/steamwar/bungeecore/commands/EventCommand.java @@ -21,6 +21,7 @@ package de.steamwar.bungeecore.commands; import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.EventStarter; +import de.steamwar.bungeecore.Message; import de.steamwar.bungeecore.Subserver; import de.steamwar.bungeecore.sql.Event; import de.steamwar.bungeecore.sql.EventFight; @@ -37,9 +38,6 @@ import java.util.Set; public class EventCommand extends BasicCommand { - public static final DateTimeFormatter TIME_FORMAT = DateTimeFormatter.ofPattern("HH:mm"); - static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern("dd.MM."); - public EventCommand() { super("event", ""); } @@ -64,13 +62,13 @@ public class EventCommand extends BasicCommand { Team team = Team.get(args[0]); if(team == null){ - BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDieses Team gibt es nicht"); + Message.send("EVENT_NO_TEAM", player); return; } Subserver eventArena = EventStarter.getEventServer().get(team.getTeamId()); if(eventArena == null || !Subserver.getServerList().contains(eventArena)){ - BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDas Team kämpft derzeit nicht"); + Message.send("EVENT_NO_FIGHT_TEAM", player); return; } @@ -78,23 +76,20 @@ public class EventCommand extends BasicCommand { } private void noCurrentEvent(ProxiedPlayer player){ - BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cDerzeit findet kein Event statt"); + Message.send("EVENT_NO_CURRENT", player); List coming = Event.getComing(); if(!coming.isEmpty()){ - BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§eKommende Events§8:"); + DateTimeFormatter dateFormat = DateTimeFormatter.ofPattern(Message.parse("EVENT_DATE_FORMAT", player)); + Message.send("EVENT_COMING", player); for(Event e : coming){ - BungeeCore.send(player, "§7" + - e.getStart().toLocalDateTime().format(DATE_FORMAT) + - "§8-§7" + - e.getEnd().toLocalDateTime().format(DATE_FORMAT) + - "§8: §e" + - e.getEventName()); + Message.send("EVENT_COMING_EVENT", player, e.getStart().toLocalDateTime().format(dateFormat), e.getEnd().toLocalDateTime().format(dateFormat), e.getEventName()); Set teams = TeamTeilnahme.getTeams(e.getEventID()); if(!teams.isEmpty()){ - StringBuilder tline = new StringBuilder("§7 Mit§8: "); + StringBuilder tline = new StringBuilder(); for(Team t : teams){ - tline.append("§").append(t.getTeamColor()).append(t.getTeamKuerzel()).append(" "); + tline.append(Message.parse("EVENT_COMING_TEAM", player, t.getTeamColor(), t.getTeamKuerzel())); } + Message.send("EVENT_COMING_TEAMS", player, tline.toString()); BungeeCore.send(player, tline.toString()); } } @@ -102,33 +97,30 @@ public class EventCommand extends BasicCommand { } private void eventOverview(ProxiedPlayer player, Event currentEvent){ - BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§8/§eevent §8[§eTeam§8] - §7Um dich zum Kampf zu teleportieren"); + Message.send("EVENT_SYNTAX", player); List fights = EventFight.getEvent(currentEvent.getEventID()); Instant now = Instant.now(); - BungeeCore.send(player, "§e§l" + currentEvent.getEventName()); + Message.send("EVENT_CURRENT_EVENT", player, currentEvent.getEventName()); + DateTimeFormatter timeFormat = DateTimeFormatter.ofPattern(Message.parse("EVENT_TIME_FORMAT", player)); for(EventFight fight : fights){ Team blue = Team.get(fight.getTeamBlue()); Team red = Team.get(fight.getTeamRed()); - StringBuilder fline = new StringBuilder("§7") - .append(fight.getStartTime().toLocalDateTime().format(TIME_FORMAT)) - .append(" §e") - .append(blue.getTeamKuerzel()) - .append("§8 vs §e") - .append(red.getTeamKuerzel()); + StringBuilder fline = new StringBuilder(Message.parse("EVENT_CURRENT_FIGHT", player, fight.getStartTime().toLocalDateTime().format(timeFormat), blue.getTeamColor(), blue.getTeamKuerzel(), + red.getTeamColor(), red.getTeamKuerzel())); if(now.isAfter(fight.getStartTime().toInstant().plus(35, ChronoUnit.MINUTES))){ switch(fight.getErgebnis()){ case 1: - fline.append("§8: §7Sieg §e").append(blue.getTeamKuerzel()); + fline.append(Message.parse("EVENT_CURRENT_FIGHT_WIN", player, blue.getTeamColor(), blue.getTeamKuerzel())); break; case 2: - fline.append("§8: §7Sieg §e").append(red.getTeamKuerzel()); + fline.append(Message.parse("EVENT_CURRENT_FIGHT_WIN", player, red.getTeamColor(), red.getTeamKuerzel())); break; default: - fline.append("§8: §7Unentschieden"); + fline.append(Message.parse("EVENT_CURRENT_FIGHT_DRAW", player)); } } diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index bca8aee..4867c69 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -154,6 +154,22 @@ CHALLENGE_CHALLENGED_MAP=auf §e{0} §7 CHALLENGE_ACCEPT=§7Klicke §ehier§7, um die Herausforderung anzunehmen CHALLENGE_ACCEPT_HOVER=§aHerausforderung annehmen +#EventCommand +EVENT_TIME_FORMAT=HH:mm +EVENT_DATE_FORMAT=dd.MM. +EVENT_SYNTAX=§8/§eevent §8[§eTeam§8] - §7Um dich zum Kampf zu teleportieren +EVENT_NO_TEAM=§cDieses Team gibt es nicht +EVENT_NO_FIGHT_TEAM=§cDas Team kämpft derzeit nicht +EVENT_NO_CURRENT=§cDerzeit findet kein Event statt +EVENT_COMING=§eKommende Events§8: +EVENT_COMING_EVENT=§7{0}§8-§7{1}§8: §e{2} +EVENT_COMING_TEAMS=§7 Mit§8:{0} +EVENT_COMING_TEAM= §{0}{1} +EVENT_CURRENT_EVENT=§e§l{0} +EVENT_CURRENT_FIGHT=§7{0} §{1}{2}§8 vs §{3}{4} +EVENT_CURRENT_FIGHT_WIN=§8: §7Sieg §{0}{1} +EVENT_CURRENT_FIGHT_DRAW=§8: §7Unentschieden + #CheckCommand CHECK_REMINDER=§7Es sind §e{0} §7Schematics zu prüfen§8! CHECK_NOT_CHECKING=§cDu prüfst derzeit nicht.