SteamWar/BungeeCore
Archiviert
13
2

Merge pull request 'NoFabricFabric' (#460) from NoFabricFabric into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Reviewed-on: #460
Reviewed-by: Lixfel <lixfel@steamwar.de>
Dieser Commit ist enthalten in:
Lixfel 2023-02-23 10:21:31 +01:00
Commit c0822b726b

Datei anzeigen

@ -41,6 +41,7 @@ public class NonFabricFabricCheck extends BasicListener {
private final Set<UUID> usingFabric = new HashSet<>(); private final Set<UUID> usingFabric = new HashSet<>();
private final Set<ProxiedPlayer> checking = new HashSet<>(); private final Set<ProxiedPlayer> checking = new HashSet<>();
private final Set<ProxiedPlayer> vanilla = new HashSet<>();
{ {
BungeeCord.getInstance().getScheduler().schedule(BungeeCore.get(), usingFabric::clear, 0, 15, TimeUnit.MINUTES); BungeeCord.getInstance().getScheduler().schedule(BungeeCore.get(), usingFabric::clear, 0, 15, TimeUnit.MINUTES);
@ -52,14 +53,23 @@ public class NonFabricFabricCheck extends BasicListener {
if(!(sender instanceof ProxiedPlayer)) if(!(sender instanceof ProxiedPlayer))
return; return;
if(!e.getTag().equals("minecraft:brand")) ProxiedPlayer p = (ProxiedPlayer) sender;
return; if (e.getTag().equals("minecraft:register") && new String(e.getData()).contains("fabric-screen-handler-api-v1:open_screen")) {
BungeeCord.getInstance().getScheduler().schedule(BungeeCore.get(), () -> {
if(!new String(e.getData()).equals("vanilla")){ if (!sender.isConnected()) return;
if (!vanilla.remove(p)) return;
if (Storage.fabricCheckedPlayers.containsKey(p)) return;
p.disconnect(Message.parse("MOD_USE_MODSENDER", p));
}, 25, TimeUnit.SECONDS);
return; return;
} }
ProxiedPlayer p = (ProxiedPlayer) sender; if(!e.getTag().equals("minecraft:brand"))
return;
if(!new String(e.getData()).equals("vanilla"))
return;
vanilla.add(p);
BungeeCord.getInstance().getScheduler().schedule(BungeeCore.get(), () -> { BungeeCord.getInstance().getScheduler().schedule(BungeeCore.get(), () -> {
if (!p.isConnected()) return; if (!p.isConnected()) return;
@ -82,5 +92,6 @@ public class NonFabricFabricCheck extends BasicListener {
if (checking.remove(e.getPlayer())) { if (checking.remove(e.getPlayer())) {
usingFabric.add(e.getPlayer().getUniqueId()); usingFabric.add(e.getPlayer().getUniqueId());
} }
vanilla.remove(e.getPlayer());
} }
} }