diff --git a/src/main/java/world/bentobox/challenges/panel/TryToComplete.java b/src/main/java/world/bentobox/challenges/panel/TryToComplete.java index 0a19811..d7d2944 100644 --- a/src/main/java/world/bentobox/challenges/panel/TryToComplete.java +++ b/src/main/java/world/bentobox/challenges/panel/TryToComplete.java @@ -302,11 +302,18 @@ public class TryToComplete ChallengeType type = this.challenge.getChallengeType(); // Check the world - if (!this.challenge.getUniqueId().startsWith(Util.getWorld(this.world).getName())) + 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"); result = EMPTY_RESULT; } + // Player is not on island + else if (!this.addon.getIslands().userIsOnIsland(this.user.getWorld(), this.user)) + { + this.user.sendMessage("challenges.error.not-on-island"); + result = EMPTY_RESULT; + } // Check if user has unlocked challenges level. else if (!this.challenge.getLevel().equals(ChallengesManager.FREE) && !this.manager.isLevelUnlocked(this.user, this.world, this.manager.getLevel(this.challenge.getLevel()))) @@ -556,7 +563,7 @@ public class TryToComplete { ChallengeResult result; - if (!this.addon.getIslands().userIsOnIsland(this.world, this.user)) + if (!this.addon.getIslands().userIsOnIsland(this.user.getWorld(), this.user)) { // Player is not on island this.user.sendMessage("challenges.error.not-on-island");