Ignore invalid nicknames in AntiVanish (#344)
https://help.minecraft.net/hc/en-us/articles/4408950195341-Minecraft-Java-Edition-Username-VS-Gamertag-FAQ#h_01GE5JWW0210X02JZN2FP9CREC
This commit is contained in:
@@ -88,6 +88,8 @@ public class AntiVanish extends Module {
|
|||||||
|
|
||||||
for (String playerName : completionPlayerCache) {
|
for (String playerName : completionPlayerCache) {
|
||||||
if (Objects.equals(playerName, mc.player.getName().getString())) continue;
|
if (Objects.equals(playerName, mc.player.getName().getString())) continue;
|
||||||
|
if (playerName.contains(" ")) continue;
|
||||||
|
if (playerName.length() < 3 || playerName.length() > 16) continue;
|
||||||
if (joinedOrQuit.test(playerName)) {
|
if (joinedOrQuit.test(playerName)) {
|
||||||
info("Player joined: " + playerName);
|
info("Player joined: " + playerName);
|
||||||
}
|
}
|
||||||
@@ -95,6 +97,8 @@ public class AntiVanish extends Module {
|
|||||||
|
|
||||||
for (String playerName : lastUsernames) {
|
for (String playerName : lastUsernames) {
|
||||||
if (Objects.equals(playerName, mc.player.getName().getString())) continue;
|
if (Objects.equals(playerName, mc.player.getName().getString())) continue;
|
||||||
|
if (playerName.contains(" ")) continue;
|
||||||
|
if (playerName.length() < 3 || playerName.length() > 16) continue;
|
||||||
if (joinedOrQuit.test(playerName)) {
|
if (joinedOrQuit.test(playerName)) {
|
||||||
info("Player left: " + playerName);
|
info("Player left: " + playerName);
|
||||||
}
|
}
|
||||||
@@ -124,6 +128,8 @@ public class AntiVanish extends Module {
|
|||||||
for (UUID uuid : oldPlayers.keySet()) {
|
for (UUID uuid : oldPlayers.keySet()) {
|
||||||
if (playerCache.containsKey(uuid)) continue;
|
if (playerCache.containsKey(uuid)) continue;
|
||||||
String name = oldPlayers.get(uuid);
|
String name = oldPlayers.get(uuid);
|
||||||
|
if (name.contains(" ")) continue;
|
||||||
|
if (name.length() < 3 || name.length() > 16) continue;
|
||||||
if (messageCache.stream().noneMatch(s -> s.contains(name))) {
|
if (messageCache.stream().noneMatch(s -> s.contains(name))) {
|
||||||
warning(name + " has gone into vanish.");
|
warning(name + " has gone into vanish.");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user