From 40d10b5e3972477043c8ec9134ec920b22694744 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Tue, 22 Nov 2022 16:51:13 +0100 Subject: [PATCH] Add message to CalendarListener --- src/de/steamwar/bungeecore/listeners/CalendarListener.java | 7 ++++++- src/de/steamwar/messages/BungeeCore.properties | 3 ++- src/de/steamwar/messages/BungeeCore_de.properties | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/de/steamwar/bungeecore/listeners/CalendarListener.java b/src/de/steamwar/bungeecore/listeners/CalendarListener.java index 935ac5c..530b926 100644 --- a/src/de/steamwar/bungeecore/listeners/CalendarListener.java +++ b/src/de/steamwar/bungeecore/listeners/CalendarListener.java @@ -19,14 +19,17 @@ package de.steamwar.bungeecore.listeners; +import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.Message; import de.steamwar.bungeecore.commands.CalendarCommand; +import net.md_5.bungee.BungeeCord; import net.md_5.bungee.api.chat.ClickEvent; import net.md_5.bungee.api.event.PostLoginEvent; import net.md_5.bungee.event.EventHandler; import java.time.LocalDate; import java.time.Month; +import java.util.concurrent.TimeUnit; public class CalendarListener extends BasicListener { @@ -44,6 +47,8 @@ public class CalendarListener extends BasicListener { return; } - Message.send("ADVENT_CALENDAR_MESSAGE", event.getPlayer(), null, new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/calendar")); + BungeeCord.getInstance().getScheduler().schedule(BungeeCore.get(), () -> { + Message.send("ADVENT_CALENDAR_MESSAGE", event.getPlayer(), Message.parse("ADVENT_CALENDAR_MESSAGE_HOVER", event.getPlayer()), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/calendar")); + }, 2, TimeUnit.SECONDS); } } diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index b8d510c..583327d 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -653,4 +653,5 @@ BUILDERCLOUD_VERSION=§cUnknown version. # Advent Calendar ADVENT_CALENDAR_TITLE=§eAdvent Calendar ADVENT_CALENDAR_DAY=§7Day§8: §e{0} -ADVENT_CALENDAR_MESSAGE=§7Did you already open your advent calendar? \ No newline at end of file +ADVENT_CALENDAR_MESSAGE=§eDid you already open your advent calendar? +ADVENT_CALENDAR_MESSAGE_HOVER=§eClick to open! \ No newline at end of file diff --git a/src/de/steamwar/messages/BungeeCore_de.properties b/src/de/steamwar/messages/BungeeCore_de.properties index 280b2f4..89e1ea4 100644 --- a/src/de/steamwar/messages/BungeeCore_de.properties +++ b/src/de/steamwar/messages/BungeeCore_de.properties @@ -631,4 +631,5 @@ BUILDERCLOUD_VERSION=§cUnbekannte Version. # Advent Calendar ADVENT_CALENDAR_TITLE=§eAdventskalender ADVENT_CALENDAR_DAY=§7Tag§8: §e{0} -ADVENT_CALENDAR_MESSAGE=§7Hast du heute schon dein Geschenk geholt? \ No newline at end of file +ADVENT_CALENDAR_MESSAGE=§eHast du heute schon dein Geschenk geholt? +ADVENT_CALENDAR_MESSAGE_HOVER=§eKlicken zum öffnen! \ No newline at end of file