geforkt von SteamWar/BungeeCore
Merge pull request 'NoFabricFabric' (#460) from NoFabricFabric into master
Reviewed-on: SteamWar/BungeeCore#460 Reviewed-by: Lixfel <lixfel@steamwar.de>
Dieser Commit ist enthalten in:
Commit
c0822b726b
@ -41,6 +41,7 @@ public class NonFabricFabricCheck extends BasicListener {
|
||||
private final Set<UUID> usingFabric = 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);
|
||||
@ -52,14 +53,23 @@ public class NonFabricFabricCheck extends BasicListener {
|
||||
if(!(sender instanceof ProxiedPlayer))
|
||||
return;
|
||||
|
||||
if(!e.getTag().equals("minecraft:brand"))
|
||||
return;
|
||||
|
||||
if(!new String(e.getData()).equals("vanilla")){
|
||||
ProxiedPlayer p = (ProxiedPlayer) sender;
|
||||
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 (!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;
|
||||
}
|
||||
|
||||
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(), () -> {
|
||||
if (!p.isConnected()) return;
|
||||
@ -82,5 +92,6 @@ public class NonFabricFabricCheck extends BasicListener {
|
||||
if (checking.remove(e.getPlayer())) {
|
||||
usingFabric.add(e.getPlayer().getUniqueId());
|
||||
}
|
||||
vanilla.remove(e.getPlayer());
|
||||
}
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren