From 8a8124f36e355b7d77e3462c973e67d6181517a6 Mon Sep 17 00:00:00 2001 From: BONNe Date: Thu, 11 Jan 2024 09:40:20 +0200 Subject: [PATCH] Fixes crash when player in CREATIVE shift+clicks on INVENTORY challenge. Limit completion time to 2, if player is in creative instead of Integer.MAX_VALUE Fixes #330 --- .../java/world/bentobox/challenges/tasks/TryToComplete.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/world/bentobox/challenges/tasks/TryToComplete.java b/src/main/java/world/bentobox/challenges/tasks/TryToComplete.java index aaf3ff3..971923a 100644 --- a/src/main/java/world/bentobox/challenges/tasks/TryToComplete.java +++ b/src/main/java/world/bentobox/challenges/tasks/TryToComplete.java @@ -952,6 +952,8 @@ public class TryToComplete else { requiredItems = Collections.emptyList(); + // Set maxTime to 2, to not crash client when completing 2147483647 times. + maxTimes = 2; } // Return the result