aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.gradle2
-rw-r--r--src/main/java/net/elytrium/limboauth/LimboAuth.java8
2 files changed, 7 insertions, 3 deletions
diff --git a/build.gradle b/build.gradle
index 875dc2f..2090356 100644
--- a/build.gradle
+++ b/build.gradle
@@ -10,7 +10,7 @@ plugins {
}
setGroup("net.elytrium")
-setVersion("1.0.8")
+setVersion("1.0.9-SNAPSHOT")
java {
setSourceCompatibility(JavaVersion.VERSION_11)
diff --git a/src/main/java/net/elytrium/limboauth/LimboAuth.java b/src/main/java/net/elytrium/limboauth/LimboAuth.java
index eed58f3..15cc0be 100644
--- a/src/main/java/net/elytrium/limboauth/LimboAuth.java
+++ b/src/main/java/net/elytrium/limboauth/LimboAuth.java
@@ -834,17 +834,21 @@ public class LimboAuth {
}
public void incrementBruteforceAttempts(InetAddress address) {
- this.bruteforceCache.get(address).incrementAttempts();
+ this.getBruteforceUser(address).incrementAttempts();
}
public int getBruteforceAttempts(InetAddress address) {
+ return this.getBruteforceUser(address).getAttempts();
+ }
+
+ private CachedBruteforceUser getBruteforceUser(InetAddress address) {
CachedBruteforceUser user = this.bruteforceCache.get(address);
if (user == null) {
user = new CachedBruteforceUser(System.currentTimeMillis());
this.bruteforceCache.put(address, user);
}
- return user.getAttempts();
+ return user;
}
public void clearBruteforceAttempts(InetAddress address) {