Easter Egg: LIXFEL in chat
Dieser Commit ist enthalten in:
Ursprung
245b1a1c5f
Commit
4c8c0ed4e3
@ -4,21 +4,27 @@ import de.steamwar.bungeecore.BungeeCore;
|
|||||||
import de.steamwar.bungeecore.Servertype;
|
import de.steamwar.bungeecore.Servertype;
|
||||||
import de.steamwar.bungeecore.Subserver;
|
import de.steamwar.bungeecore.Subserver;
|
||||||
import de.steamwar.bungeecore.commands.BauCommand;
|
import de.steamwar.bungeecore.commands.BauCommand;
|
||||||
import de.steamwar.bungeecore.sql.Team;
|
|
||||||
import de.steamwar.bungeecore.sql.SteamwarUser;
|
import de.steamwar.bungeecore.sql.SteamwarUser;
|
||||||
|
import de.steamwar.bungeecore.sql.Team;
|
||||||
import net.md_5.bungee.api.ChatColor;
|
import net.md_5.bungee.api.ChatColor;
|
||||||
import net.md_5.bungee.api.ChatMessageType;
|
import net.md_5.bungee.api.ChatMessageType;
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
|
import net.md_5.bungee.api.Title;
|
||||||
|
import net.md_5.bungee.api.chat.TextComponent;
|
||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
import net.md_5.bungee.api.event.ChatEvent;
|
import net.md_5.bungee.api.event.ChatEvent;
|
||||||
import net.md_5.bungee.api.event.TabCompleteEvent;
|
import net.md_5.bungee.api.event.TabCompleteEvent;
|
||||||
import net.md_5.bungee.api.event.TabCompleteResponseEvent;
|
import net.md_5.bungee.api.event.TabCompleteResponseEvent;
|
||||||
|
import net.md_5.bungee.api.scheduler.TaskScheduler;
|
||||||
import net.md_5.bungee.event.EventHandler;
|
import net.md_5.bungee.event.EventHandler;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
public class ChatListener extends BasicListener {
|
public class ChatListener extends BasicListener {
|
||||||
|
|
||||||
|
private static Title LIXFEL = ProxyServer.getInstance().createTitle().fadeIn(5).fadeOut(20).stay(30).title(TextComponent.fromLegacyText("§4§lLIXFEL"));
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onChatEvent(ChatEvent e){
|
public void onChatEvent(ChatEvent e){
|
||||||
if(e.getMessage().startsWith("/"))
|
if(e.getMessage().startsWith("/"))
|
||||||
@ -42,9 +48,25 @@ public class ChatListener extends BasicListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void lixfelAlert(ProxiedPlayer sender){
|
||||||
|
ProxyServer.getInstance().getPlayers().forEach(p -> LIXFEL.send(p));
|
||||||
|
final String l = "§8Lixfel»" + 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 + "Leider bin ich nur ein Mensch und höre nicht alles."), 6, TimeUnit.SECONDS);
|
||||||
|
scheduler.schedule(BungeeCore.get(), () -> BungeeCore.send(sender, l + "Daher bitte ich dich, das Problem bzw. den Fehler im Forum in der Kategorie §eFehler melden §cmit einer ausreichenden Beschreibung zu hinterlegen."), 11, 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"))
|
||||||
|
lixfelAlert(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!");
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren