diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/EncryptionUtil.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/auth/protocollib/EncryptionUtil.java similarity index 99% rename from bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/EncryptionUtil.java rename to bukkit/src/main/java/com/github/games647/fastlogin/bukkit/auth/protocollib/EncryptionUtil.java index c3c5dad3..f1228885 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/EncryptionUtil.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/auth/protocollib/EncryptionUtil.java @@ -116,7 +116,7 @@ final class EncryptionUtil { * @param random random generator * @return a token with 4 bytes long */ - public static byte[] generateVerifyToken(RandomGenerator random) { + public static byte[] generateVerifyToken(Random random) { byte[] token = new byte[VERIFY_TOKEN_LENGTH]; random.nextBytes(token); return token; diff --git a/core/src/main/java/com/github/games647/fastlogin/core/hooks/DefaultPasswordGenerator.java b/core/src/main/java/com/github/games647/fastlogin/core/hooks/DefaultPasswordGenerator.java index 549039ea..7d27bdf4 100644 --- a/core/src/main/java/com/github/games647/fastlogin/core/hooks/DefaultPasswordGenerator.java +++ b/core/src/main/java/com/github/games647/fastlogin/core/hooks/DefaultPasswordGenerator.java @@ -26,7 +26,7 @@ package com.github.games647.fastlogin.core.hooks; import java.security.SecureRandom; -import java.util.random.RandomGenerator; +import java.util.Random; import java.util.stream.IntStream; public class DefaultPasswordGenerator
implements PasswordGenerator
{ @@ -35,7 +35,7 @@ public class DefaultPasswordGenerator
implements PasswordGenerator
{
private static final char[] PASSWORD_CHARACTERS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
.toCharArray();
- private final RandomGenerator random = new SecureRandom();
+ private final Random random = new SecureRandom();
@Override
public String getRandomPassword(P player) {
diff --git a/core/src/main/java/com/github/games647/fastlogin/core/hooks/bedrock/FloodgateService.java b/core/src/main/java/com/github/games647/fastlogin/core/hooks/bedrock/FloodgateService.java
index d48c62dc..7c14f43b 100644
--- a/core/src/main/java/com/github/games647/fastlogin/core/hooks/bedrock/FloodgateService.java
+++ b/core/src/main/java/com/github/games647/fastlogin/core/hooks/bedrock/FloodgateService.java
@@ -59,13 +59,16 @@ public class FloodgateService extends BedrockService {
premiumUUID = core.getResolver().findProfile(username);
}
- if (premiumUUID.isEmpty()
+ if (premiumUUID.isPresent()
|| (!isNameChanged(source, username, premiumUUID.get())
&& !isUsernameAvailable(source, username, profile))) {
//nothing detected the player as premium -> start a cracked session
diff --git a/core/src/main/java/com/github/games647/fastlogin/core/storage/StoredProfile.java b/core/src/main/java/com/github/games647/fastlogin/core/storage/StoredProfile.java
index 313f6939..a2e2d60b 100644
--- a/core/src/main/java/com/github/games647/fastlogin/core/storage/StoredProfile.java
+++ b/core/src/main/java/com/github/games647/fastlogin/core/storage/StoredProfile.java
@@ -163,16 +163,16 @@ public class StoredProfile extends Profile {
}
@Override
- public synchronized boolean equals(Object o) {
- if (this == o) {
+ public synchronized boolean equals(Object other) {
+ if (this == other) {
return true;
}
- if (!(o instanceof StoredProfile that)) {
+ if (!(other instanceof StoredProfile)) {
return false;
}
-
- if (!super.equals(o)) {
+ StoredProfile that = (StoredProfile) other;
+ if (!super.equals(other)) {
return false;
}