diff --git a/README.md b/README.md index 5623d12c..f4409258 100644 --- a/README.md +++ b/README.md @@ -60,13 +60,13 @@ Possible values: `Premium`, `Cracked`, `Unknown` ## Requirements -* Java 17+ +* Java 17+ (Recommended) * Server software in offlinemode: * Spigot (or a fork e.g. Paper) 1.8.8+ * Protocol plugin: - * [ProtocolLib 5.0+](https://www.spigotmc.org/resources/protocollib.1997/) or + * [ProtocolLib 5.1+](https://www.spigotmc.org/resources/protocollib.1997/) or * [ProtocolSupport](https://www.spigotmc.org/resources/protocolsupport.7201/) - * Latest BungeeCord (or a fork e.g. Waterfall) + * Latest BungeeCord (or a fork e.g. Waterfall) or Velocity * An auth plugin. ### Supported auth plugins diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/BukkitScheduler.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/BukkitScheduler.java index 5674f875..59ec6bb2 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/BukkitScheduler.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/BukkitScheduler.java @@ -39,7 +39,7 @@ public class BukkitScheduler extends AsyncScheduler { public BukkitScheduler(Plugin plugin, Logger logger) { super(logger, command -> Bukkit.getScheduler().runTaskAsynchronously(plugin, command)); - syncExecutor = r -> Bukkit.getScheduler().runTask(plugin, r); + syncExecutor = task -> Bukkit.getScheduler().runTask(plugin, task); } public Executor getSyncExecutor() { diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/ProtocolLibListener.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/ProtocolLibListener.java index 7c089eb0..904a769f 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/ProtocolLibListener.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/ProtocolLibListener.java @@ -177,7 +177,7 @@ public class ProtocolLibListener extends PacketAdapter { ClientPublicKey clientPublicKey, byte[] expectedToken) { try { if (new MinecraftVersion(1, 19, 0).atOrAbove() - && !(new MinecraftVersion(1, 19, 3).atOrAbove())) { + && !new MinecraftVersion(1, 19, 3).atOrAbove()) { Either either = packet.getSpecificModifier(Either.class).read(0); if (clientPublicKey == null) { Optional left = either.left(); diff --git a/core/src/main/java/com/github/games647/fastlogin/core/antibot/TickingRateLimiter.java b/core/src/main/java/com/github/games647/fastlogin/core/antibot/TickingRateLimiter.java index d9c815ce..aa807a02 100644 --- a/core/src/main/java/com/github/games647/fastlogin/core/antibot/TickingRateLimiter.java +++ b/core/src/main/java/com/github/games647/fastlogin/core/antibot/TickingRateLimiter.java @@ -107,7 +107,7 @@ public class TickingRateLimiter implements RateLimiter { } } - private static class TimeRecord implements Comparable { + private static class TimeRecord implements Comparable { private final long firstMinuteRecord; private final long expireTime; @@ -131,9 +131,9 @@ public class TickingRateLimiter implements RateLimiter { return firstMinuteRecord + expireTime <= now; } - @Override - public int compareTo(Long other) { + public int compareTo(long other) { if (other < firstMinuteRecord) { + // other is earlier return -1; } @@ -143,5 +143,10 @@ public class TickingRateLimiter implements RateLimiter { return 0; } + + @Override + public int compareTo(TimeRecord other) { + return compareTo(other.firstMinuteRecord); + } } } diff --git a/core/src/main/java/com/github/games647/fastlogin/core/shared/FloodgateManagement.java b/core/src/main/java/com/github/games647/fastlogin/core/shared/FloodgateManagement.java index 9a59f550..939dcb3c 100644 --- a/core/src/main/java/com/github/games647/fastlogin/core/shared/FloodgateManagement.java +++ b/core/src/main/java/com/github/games647/fastlogin/core/shared/FloodgateManagement.java @@ -33,6 +33,7 @@ import org.geysermc.floodgate.api.player.FloodgatePlayer; import java.io.IOException; import java.net.InetSocketAddress; +import java.util.Locale; import java.util.Optional; import java.util.UUID; @@ -61,9 +62,9 @@ public abstract class FloodgateManagement