From 54ed8924a631fab786978fddbe1c34c2196e46b8 Mon Sep 17 00:00:00 2001 From: jojo Date: Sun, 26 Jul 2020 12:48:47 +0200 Subject: [PATCH] Add "YOYONOW" --- .../bungeecore/listeners/ChatListener.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/de/steamwar/bungeecore/listeners/ChatListener.java b/src/de/steamwar/bungeecore/listeners/ChatListener.java index 6780e947..edb7a4cd 100644 --- a/src/de/steamwar/bungeecore/listeners/ChatListener.java +++ b/src/de/steamwar/bungeecore/listeners/ChatListener.java @@ -25,6 +25,7 @@ import java.util.concurrent.TimeUnit; public class ChatListener extends BasicListener { private static final Title LIXFEL = ProxyServer.getInstance().createTitle().fadeIn(5).fadeOut(20).stay(30).title(TextComponent.fromLegacyText("§4§lLIXFEL")); + private static final Title YOYONOW = ProxyServer.getInstance().createTitle().fadeIn(5).fadeOut(20).stay(30).title(TextComponent.fromLegacyText("§4§lYOYONOW")); @EventHandler public void onChatEvent(ChatEvent e){ @@ -75,7 +76,7 @@ public class ChatListener extends BasicListener { } } - private void lixfelAlert(ProxiedPlayer sender){ + private void lixfelAlert(ProxiedPlayer sender) { LIXFEL.send(sender); final String l = "§8Lixfel»" + sender.getName() + " §c"; BungeeCore.send(sender, ChatMessageType.ACTION_BAR, "§4§lTechnische Probleme?"); @@ -87,12 +88,25 @@ public class ChatListener extends BasicListener { scheduler.schedule(BungeeCore.get(), () -> BungeeCore.send(sender, l + "Ich wünsche dir noch weiterhin ein reibungsloses Spielerlebnis."), 15, TimeUnit.SECONDS); } + private void yoyonowAlert(ProxiedPlayer sender) { + YOYONOW.send(sender); + final String l = "§8YoyoNow»" + sender.getName() + " §c"; + BungeeCore.send(sender, ChatMessageType.ACTION_BAR, "§4§lTechnische Probleme?"); + TaskScheduler scheduler = ProxyServer.getInstance().getScheduler(); + scheduler.schedule(BungeeCore.get(), () -> BungeeCore.send(sender, l + "Du hast mich gerufen!"), 3, TimeUnit.SECONDS); + scheduler.schedule(BungeeCore.get(), () -> BungeeCore.send(sender, l + "Ich würde dir gerne den Befehl \"/bug \" ans Herz legen."), 10, TimeUnit.SECONDS); + scheduler.schedule(BungeeCore.get(), () -> BungeeCore.send(sender, l + "Vielen Dank."), 12, TimeUnit.SECONDS); + scheduler.schedule(BungeeCore.get(), () -> BungeeCore.send(sender, l + "Ich wünsche dir noch weiterhin ein reibungsloses Spielerlebnis."), 15, TimeUnit.SECONDS); + } + private void onChat(ChatEvent e){ if(e.getSender() instanceof ProxiedPlayer){ ProxiedPlayer sender = (ProxiedPlayer) e.getSender(); - if(e.getMessage().contains("LIXFEL")) + if (e.getMessage().contains("LIXFEL")) lixfelAlert(sender); + if (e.getMessage().contains("YOYONOW")) + yoyonowAlert(sender); if(sender.getChatMode() != ProxiedPlayer.ChatMode.SHOWN){ BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§cUm Chatnachrichten versenden zu können, musst du auch welche empfangen!");