From 9704ed32aa37189bc8f9790ce6e7f0715bfe655d Mon Sep 17 00:00:00 2001 From: BONNe1704 Date: Thu, 16 May 2019 10:30:01 +0300 Subject: [PATCH] Fix issue when IslandTypeChallenges required blocks were cleared if completion was uncessesfull. The issue was that it cleared wrong map. It must clear priority queue, but cleared required elements. --- .../java/world/bentobox/challenges/tasks/TryToComplete.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/world/bentobox/challenges/tasks/TryToComplete.java b/src/main/java/world/bentobox/challenges/tasks/TryToComplete.java index ca915a8..aff57be 100644 --- a/src/main/java/world/bentobox/challenges/tasks/TryToComplete.java +++ b/src/main/java/world/bentobox/challenges/tasks/TryToComplete.java @@ -162,7 +162,9 @@ public class TryToComplete this.permissionPrefix = permissionPrefix; this.user = user; this.manager = addon.getChallengesManager(); - this.challenge = challenge; + // To avoid any modifications that may accure to challenges in current completion + // just clone it. + this.challenge = challenge.clone(); this.topLabel = topLabel; } @@ -1021,7 +1023,7 @@ public class TryToComplete // kick garbage collector blocks.clear(); blocksFound.clear(); - requiredMap.clear(); + blockFromWorld.clear(); return EMPTY_RESULT; }