diff --git a/src/de/steamwar/bungeecore/BungeeCore.java b/src/de/steamwar/bungeecore/BungeeCore.java index 85d43d7d..fcd6c40d 100644 --- a/src/de/steamwar/bungeecore/BungeeCore.java +++ b/src/de/steamwar/bungeecore/BungeeCore.java @@ -2,6 +2,7 @@ package de.steamwar.bungeecore; import de.steamwar.bungeecore.commands.*; import de.steamwar.bungeecore.listeners.*; +import de.steamwar.bungeecore.listeners.mods.Fabric; import de.steamwar.bungeecore.listeners.mods.Forge; import de.steamwar.bungeecore.listeners.mods.LabyMod; import de.steamwar.bungeecore.sql.SQL; @@ -56,6 +57,7 @@ public class BungeeCore extends Plugin { new ConnectionListener(); new Forge(); new LabyMod(); + new Fabric(); new ChatListener(); new BanListener(); new CheckListener(); diff --git a/src/de/steamwar/bungeecore/listeners/mods/Fabric.java b/src/de/steamwar/bungeecore/listeners/mods/Fabric.java new file mode 100644 index 00000000..a0e72beb --- /dev/null +++ b/src/de/steamwar/bungeecore/listeners/mods/Fabric.java @@ -0,0 +1,26 @@ +package de.steamwar.bungeecore.listeners.mods; + +import de.steamwar.bungeecore.BungeeCore; +import de.steamwar.bungeecore.listeners.BasicListener; +import net.md_5.bungee.api.connection.Connection; +import net.md_5.bungee.api.connection.ProxiedPlayer; +import net.md_5.bungee.api.event.PluginMessageEvent; +import net.md_5.bungee.event.EventHandler; + +public class Fabric extends BasicListener { + + @EventHandler + public void onPluginMessageEvent(PluginMessageEvent e){ + Connection sender = e.getSender(); + if(!(sender instanceof ProxiedPlayer)) + return; + + if(!e.getTag().equals("minecraft:brand")) + return; + + if(new String(e.getData()).contains("fabric")){ + ProxiedPlayer p = (ProxiedPlayer) sender; + p.disconnect(BungeeCore.stringToText("§7Die Verwendung von Fabric ist auf §eSteam§8War §7nicht gestattet.")); + } + } +}