Do uuid version 3 warning

This commit is contained in:
libraryaddict
2021-05-23 10:17:46 +12:00
parent 8641115c75
commit 42f04766b1
5 changed files with 28 additions and 9 deletions

View File

@@ -196,6 +196,7 @@ public class DisguiseUtilities {
private final static ConcurrentHashMap<String, DScoreTeam> teams = new ConcurrentHashMap<>();
private final static boolean java16;
private static boolean criedOverJava16;
private static HashSet<UUID> warnedSkin = new HashSet<>();
static {
final Matcher matcher = Pattern.compile("(?:1\\.)?(\\d+)").matcher(System.getProperty("java.version"));
@@ -214,6 +215,21 @@ public class DisguiseUtilities {
}
}
public static void doSkinUUIDWarning(CommandSender sender) {
if (!(sender instanceof Player)) {
return;
}
UUID uuid = ((Player) sender).getUniqueId();
if (uuid.version() == 4 || warnedSkin.contains(uuid)) {
return;
}
warnedSkin.add(uuid);
LibsMsg.SKIN_API_UUID_3.send(sender);
}
/**
* Only allow saves every 2 minutes
*/