Archiviert
1
0

Allow Fabric on Fight Servers

Dieser Commit ist enthalten in:
zOnlyKroks 2022-03-12 13:54:23 +01:00
Ursprung 657c03dff1
Commit c239dc7809
2 geänderte Dateien mit 10 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -23,11 +23,13 @@ import com.google.gson.JsonArray;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.google.gson.JsonParser; import com.google.gson.JsonParser;
import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.BungeeCore;
import de.steamwar.bungeecore.Storage;
import de.steamwar.bungeecore.listeners.BasicListener; import de.steamwar.bungeecore.listeners.BasicListener;
import de.steamwar.bungeecore.sql.Mod; import de.steamwar.bungeecore.sql.Mod;
import de.steamwar.bungeecore.sql.Punishment; import de.steamwar.bungeecore.sql.Punishment;
import de.steamwar.bungeecore.sql.SteamwarUser; import de.steamwar.bungeecore.sql.SteamwarUser;
import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.event.PlayerDisconnectEvent;
import net.md_5.bungee.api.event.PluginMessageEvent; import net.md_5.bungee.api.event.PluginMessageEvent;
import net.md_5.bungee.event.EventHandler; import net.md_5.bungee.event.EventHandler;
@ -40,6 +42,7 @@ import java.util.logging.Level;
public class Fabric extends BasicListener { public class Fabric extends BasicListener {
private final List<String> neededMods = new LinkedList<>(); private final List<String> neededMods = new LinkedList<>();
public static final Set<ProxiedPlayer> checkedPlayers = new HashSet();
{ {
neededMods.add("java"); neededMods.add("java");
@ -91,13 +94,18 @@ public class Fabric extends BasicListener {
return; return;
} }
Utils.handleMods(player,mods); if(Utils.handleMods(player,mods)) checkedPlayers.add(player);
}catch (Exception ex) { }catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
player.disconnect("§7Mod Verification failed! Contact a Developer"); player.disconnect("§7Mod Verification failed! Contact a Developer");
} }
} }
@EventHandler
public void onDisconnect(PlayerDisconnectEvent e){
checkedPlayers.remove(e.getPlayer());
}
private boolean isSortedAlphabetically(List<Mod> mods) { private boolean isSortedAlphabetically(List<Mod> mods) {
boolean isSorted = true; boolean isSorted = true;
for(int i = 0; i < mods.size() - 1; i++) { for(int i = 0; i < mods.size() - 1; i++) {

Datei anzeigen

@ -73,7 +73,7 @@ public class ModLoaderBlocker extends BasicListener {
} }
public static boolean isFabric(ProxiedPlayer player) { public static boolean isFabric(ProxiedPlayer player) {
return Storage.fabricPlayers.contains(player); return Storage.fabricPlayers.contains(player) && !Fabric.checkedPlayers.contains(player);
} }
public static void addServer(String server) { public static void addServer(String server) {