geforkt von SteamWar/BungeeCore
Fix vanilla brand check
Dieser Commit ist enthalten in:
Ursprung
277304b7f2
Commit
e4ab48a386
src/de/steamwar
@ -25,21 +25,27 @@ import de.steamwar.bungeecore.Storage;
|
||||
import net.md_5.bungee.BungeeCord;
|
||||
import net.md_5.bungee.api.connection.Connection;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
import net.md_5.bungee.api.event.LoginEvent;
|
||||
import net.md_5.bungee.api.event.PlayerDisconnectEvent;
|
||||
import net.md_5.bungee.api.event.PluginMessageEvent;
|
||||
import net.md_5.bungee.api.event.PostLoginEvent;
|
||||
import net.md_5.bungee.event.EventHandler;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class NonFabricFabricCheck extends BasicListener {
|
||||
|
||||
private Set<ProxiedPlayer> usingFabric = new HashSet<>();
|
||||
private Set<UUID> usingFabric = new HashSet<>();
|
||||
|
||||
private Set<ProxiedPlayer> checking = new HashSet<>();
|
||||
|
||||
{
|
||||
BungeeCord.getInstance().getScheduler().schedule(BungeeCore.get(), usingFabric::clear, 0, 15, TimeUnit.MINUTES);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void pluginMessageEvent(PluginMessageEvent e) {
|
||||
Connection sender = e.getSender();
|
||||
@ -65,18 +71,16 @@ public class NonFabricFabricCheck extends BasicListener {
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerPreLogin(PostLoginEvent e) {
|
||||
if (usingFabric.contains(e.getPlayer())) {
|
||||
e.getPlayer().disconnect(Message.parse("MOD_USE_MODSENDER", e.getPlayer()));
|
||||
usingFabric.remove(e.getPlayer());
|
||||
public void onPlayerPreLogin(LoginEvent e) {
|
||||
if (usingFabric.remove(e.getConnection().getUniqueId())) {
|
||||
e.getConnection().disconnect(Message.parse("MOD_USE_MODSENDER", Locale.getDefault()));
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerDisconnect(PlayerDisconnectEvent e) {
|
||||
if (checking.contains(e.getPlayer())) {
|
||||
usingFabric.add(e.getPlayer());
|
||||
}
|
||||
checking.remove(e.getPlayer());
|
||||
if (checking.remove(e.getPlayer())) {
|
||||
usingFabric.add(e.getPlayer().getUniqueId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ MOD_RED_PLUR=Attempted use of mods:\n{0}
|
||||
MOD_YELLOW_SING=§7Deactivate the mod §e{0}§7 to continue playing on §eSteam§8War§7.
|
||||
MOD_YELLOW_PLUR=§7Deactivate the mods\n§e{0}\n§7to continue playing on §eSteam§8War§7.
|
||||
|
||||
MOD_USE_MODSENDER=§cPlease use the §c§lSteamWarModSender§c.
|
||||
MOD_USE_MODSENDER=§cPlease use the §c§lSteamWarModSender§c or say that you are using fabric.
|
||||
|
||||
#Various commands
|
||||
ALERT=§f{0}
|
||||
|
@ -102,7 +102,7 @@ MOD_RED_PLUR=Versuchte Benutzung der Mods:\n{0}
|
||||
MOD_YELLOW_SING=§7Deaktiviere den Mod §e{0}§7, um weiter auf §eSteam§8War §7spielen zu können.
|
||||
MOD_YELLOW_PLUR=§7Deaktiviere die Mods\n§e{0}\n§7um weiter auf §eSteam§8War §7spielen zu können.
|
||||
|
||||
MOD_USE_MODSENDER=§cBitte nutze den §c§lSteamWarModSender§c.
|
||||
MOD_USE_MODSENDER=§cBitte nutze den §c§lSteamWarModSender§c oder sag uns das du Fabric nutzt.
|
||||
|
||||
#Various commands
|
||||
STAT_SERVER=§7Server §e{0}§8: §7Startfähig §e{1} §7Serveranzahl §e{2}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren