From 5e8125255301eb46cdb38dd1a8625544db176197 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Wed, 16 Sep 2020 10:22:49 +0200 Subject: [PATCH] Badlion disabling Signed-off-by: Lixfel --- .../bungeecore/listeners/mods/Badlion.java | 38 +++++++++++++++++++ .../bungeecore/listeners/mods/Utils.java | 13 +++++-- 2 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 src/de/steamwar/bungeecore/listeners/mods/Badlion.java diff --git a/src/de/steamwar/bungeecore/listeners/mods/Badlion.java b/src/de/steamwar/bungeecore/listeners/mods/Badlion.java new file mode 100644 index 0000000..1215624 --- /dev/null +++ b/src/de/steamwar/bungeecore/listeners/mods/Badlion.java @@ -0,0 +1,38 @@ +package de.steamwar.bungeecore.listeners.mods; + +import de.steamwar.bungeecore.listeners.BasicListener; +import net.md_5.bungee.api.event.PostLoginEvent; +import net.md_5.bungee.event.EventHandler; + +public class Badlion extends BasicListener { + + @EventHandler + public void onPostLogin(PostLoginEvent event) { + /* + { + "Clear Glass":{"disabled":true}, + "ClearWater":{"disabled":true}, + "FOV Changer":{"disabled":true}, + "Hitboxes":{"disabled":true}, + "MiniMap":{"disabled":true}, + "MLG Cobweb":{"disabled":true}, + "Replay":{"disabled":true}, + "Schematica":{"disabled":true}, + "ToggleSneak":{"disabled":true}, + "ToggleSprint":{"disabled":true} + } + */ + event.getPlayer().sendData("badlion:mods", ("{" + + "\"Clear Glass\":{\"disabled\":true}," + + "\"ClearWater\":{\"disabled\":true}," + + "\"FOV Changer\":{\"disabled\":true}," + + "\"Hitboxes\":{\"disabled\":true}," + + "\"MiniMap\":{\"disabled\":true}," + + "\"MLG Cobweb\":{\"disabled\":true}," + + "\"Replay\":{\"disabled\":true}," + + "\"Schematica\":{\"disabled\":true}," + + "\"ToggleSneak\":{\"disabled\":true}," + + "\"ToggleSprint\":{\"disabled\":true}" + + "}").getBytes()); + } +} diff --git a/src/de/steamwar/bungeecore/listeners/mods/Utils.java b/src/de/steamwar/bungeecore/listeners/mods/Utils.java index cf6bba5..7f6d16f 100644 --- a/src/de/steamwar/bungeecore/listeners/mods/Utils.java +++ b/src/de/steamwar/bungeecore/listeners/mods/Utils.java @@ -30,6 +30,7 @@ import java.time.Instant; import java.time.temporal.ChronoUnit; import java.util.Iterator; import java.util.List; +import java.util.logging.Level; class Utils { private Utils(){} @@ -72,16 +73,20 @@ class Utils { if(mods.size() == 1){ if(max == ModType.YELLOW) player.disconnect(BungeeCore.stringToText("§7Deaktiviere den Mod §e" + mods.get(0).getModName() + "§7, um weiter auf §eSteam§8War §7spielen zu können.")); - else - user.ban(Timestamp.from(Instant.now().plus(1, ChronoUnit.DAYS)), "Versuchte Benutzung des Mods " + mods.get(0).getModName()); + else{ + user.ban(Timestamp.from(Instant.now().plus(7, ChronoUnit.DAYS)), "Versuchte Benutzung des Mods " + mods.get(0).getModName()); + BungeeCore.log(Level.SEVERE, user.getUserName() + " " + user.getId() + " wurde automatisch wegen des Mods " + mods.get(0).getModName() + " gebannt."); + } }else{ StringBuilder sb = new StringBuilder(); mods.forEach(mod -> sb.append(mod.getModName()).append('\n')); if(max == ModType.YELLOW) player.disconnect(BungeeCore.stringToText("§7Deaktiviere die Mods\n§e" + sb.toString() + "§7um weiter auf §eSteam§8War §7spielen zu können.")); - else - user.ban(Timestamp.from(Instant.now().plus(1, ChronoUnit.DAYS)), "Versuchte Benutzung der Mods\n" + sb.toString()); + else{ + user.ban(Timestamp.from(Instant.now().plus(7, ChronoUnit.DAYS)), "Versuchte Benutzung der Mods\n" + sb.toString()); + BungeeCore.log(Level.SEVERE, user.getUserName() + " " + user.getId() + " wurde automatisch wegen der Mods " + sb.toString() + " gebannt."); + } } return false;