From d6a39b2600b83a915f791d40046f397fe1f3e338 Mon Sep 17 00:00:00 2001 From: BONNe Date: Sat, 26 Jan 2019 13:58:00 +0200 Subject: [PATCH] Add completion blockage for un-deployed challenges. --- .../world/bentobox/challenges/panel/TryToComplete.java | 7 ++++++- src/main/resources/locales/en-US.yml | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/world/bentobox/challenges/panel/TryToComplete.java b/src/main/java/world/bentobox/challenges/panel/TryToComplete.java index 2ae9d48..3e32318 100644 --- a/src/main/java/world/bentobox/challenges/panel/TryToComplete.java +++ b/src/main/java/world/bentobox/challenges/panel/TryToComplete.java @@ -302,7 +302,12 @@ public class TryToComplete ChallengeType type = this.challenge.getChallengeType(); // Check the world - if (Util.getWorld(this.world) != Util.getWorld(this.user.getWorld()) || + if (!this.challenge.isDeployed()) + { + this.user.sendMessage("challenges.error.not-deployed"); + result = EMPTY_RESULT; + } + else if (Util.getWorld(this.world) != Util.getWorld(this.user.getWorld()) || !this.challenge.getUniqueId().startsWith(Util.getWorld(this.world).getName())) { this.user.sendMessage("general.errors.wrong-world"); diff --git a/src/main/resources/locales/en-US.yml b/src/main/resources/locales/en-US.yml index 832c005..95631ef 100755 --- a/src/main/resources/locales/en-US.yml +++ b/src/main/resources/locales/en-US.yml @@ -73,6 +73,7 @@ challenges: reward-problem: '&cThere was a problem giving your reward. Ask Admin to check log!' you-still-need: '&cYou still need [amount] x [item]' + not-deployed: '&cChallenge is not deployed.' errors: challenge-level-not-available: You have not unlocked level to complete this challenge. unique-id: Unique ID [id] is already taken. Choose different.