From e2670a49e0bfe38a0868ca10f629ca204fe6a7df Mon Sep 17 00:00:00 2001 From: tastybento Date: Thu, 19 Sep 2024 21:50:18 -0700 Subject: [PATCH 1/3] Version 1.23.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a27c574..0e64535 100644 --- a/pom.xml +++ b/pom.xml @@ -64,7 +64,7 @@ -LOCAL - 1.22.0 + 1.23.0 BentoBoxWorld_Limits bentobox-world https://sonarcloud.io From 6b9262efc7feff9779f9ba62d9bbfd12bcff74a0 Mon Sep 17 00:00:00 2001 From: tastybento Date: Thu, 19 Sep 2024 21:50:40 -0700 Subject: [PATCH 2/3] Check user perms not just on login for limits --- src/main/java/world/bentobox/limits/Limits.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/world/bentobox/limits/Limits.java b/src/main/java/world/bentobox/limits/Limits.java index ff3ffb6..ec6f79c 100644 --- a/src/main/java/world/bentobox/limits/Limits.java +++ b/src/main/java/world/bentobox/limits/Limits.java @@ -210,6 +210,9 @@ public class Limits extends Addon { if (is == null) { return LIMIT_NOT_SET; } + // Check the permissions of the user and update + this.getJoinListener().checkPerms(user.getPlayer(), gm.getPermissionPrefix() + "island.limit.", + is.getUniqueId(), gm.getDescription().getName()); int limit = this.getBlockLimitListener(). getMaterialLimits(is.getWorld(), is.getUniqueId()). From f08c45822df46896f7c57adcf0e4bf00f8c96969 Mon Sep 17 00:00:00 2001 From: tastybento Date: Thu, 19 Sep 2024 21:54:05 -0700 Subject: [PATCH 3/3] Add NPE protection --- src/main/java/world/bentobox/limits/Limits.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/world/bentobox/limits/Limits.java b/src/main/java/world/bentobox/limits/Limits.java index ec6f79c..84d1f85 100644 --- a/src/main/java/world/bentobox/limits/Limits.java +++ b/src/main/java/world/bentobox/limits/Limits.java @@ -210,13 +210,13 @@ public class Limits extends Addon { if (is == null) { return LIMIT_NOT_SET; } - // Check the permissions of the user and update - this.getJoinListener().checkPerms(user.getPlayer(), gm.getPermissionPrefix() + "island.limit.", - is.getUniqueId(), gm.getDescription().getName()); - + if (user != null) { + // Check the permissions of the user and update + this.getJoinListener().checkPerms(user.getPlayer(), gm.getPermissionPrefix() + "island.limit.", + is.getUniqueId(), gm.getDescription().getName()); + } int limit = this.getBlockLimitListener(). - getMaterialLimits(is.getWorld(), is.getUniqueId()). - getOrDefault(m, -1); + getMaterialLimits(is.getWorld(), is.getUniqueId()).getOrDefault(m, -1); return limit == -1 ? LIMIT_NOT_SET : String.valueOf(limit); }