geforkt von SteamWar/BungeeCore
Merge pull request 'Add "YOYONOW"' (#101) from YOYONOW into master
Reviewed-by: Jan9103 <jan9103@steamwar.de>
Dieser Commit ist enthalten in:
Commit
1ff1492ce6
@ -25,6 +25,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
public class ChatListener extends BasicListener {
|
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 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
|
@EventHandler
|
||||||
public void onChatEvent(ChatEvent e){
|
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);
|
LIXFEL.send(sender);
|
||||||
final String l = "§8Lixfel»" + sender.getName() + " §c";
|
final String l = "§8Lixfel»" + sender.getName() + " §c";
|
||||||
BungeeCore.send(sender, ChatMessageType.ACTION_BAR, "§4§lTechnische Probleme?");
|
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);
|
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 <MESSAGE>\" 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){
|
private void onChat(ChatEvent e){
|
||||||
if(e.getSender() instanceof ProxiedPlayer){
|
if(e.getSender() instanceof ProxiedPlayer){
|
||||||
ProxiedPlayer sender = (ProxiedPlayer) e.getSender();
|
ProxiedPlayer sender = (ProxiedPlayer) e.getSender();
|
||||||
|
|
||||||
if(e.getMessage().contains("LIXFEL"))
|
if (e.getMessage().contains("LIXFEL"))
|
||||||
lixfelAlert(sender);
|
lixfelAlert(sender);
|
||||||
|
if (e.getMessage().contains("YOYONOW"))
|
||||||
|
yoyonowAlert(sender);
|
||||||
|
|
||||||
if(sender.getChatMode() != ProxiedPlayer.ChatMode.SHOWN){
|
if(sender.getChatMode() != ProxiedPlayer.ChatMode.SHOWN){
|
||||||
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§cUm Chatnachrichten versenden zu können, musst du auch welche empfangen!");
|
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§cUm Chatnachrichten versenden zu können, musst du auch welche empfangen!");
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren