mirror of
https://github.com/BentoBoxWorld/Challenges.git
synced 2025-01-04 07:18:41 +01:00
Challenges can only be done in the world that they belong.
https://github.com/BentoBoxWorld/addon-challenges/issues/24
This commit is contained in:
parent
edc2c455c4
commit
97bec0f870
@ -184,6 +184,11 @@ public class TryToComplete {
|
|||||||
* Checks if a challenge can be completed or not
|
* Checks if a challenge can be completed or not
|
||||||
*/
|
*/
|
||||||
private ChallengeResult checkIfCanCompleteChallenge() {
|
private ChallengeResult checkIfCanCompleteChallenge() {
|
||||||
|
// Check the world
|
||||||
|
if (!Util.getWorld(user.getWorld()).getName().equalsIgnoreCase(challenge.getWorld())) {
|
||||||
|
user.sendMessage("general.errors.wrong-world");
|
||||||
|
return new ChallengeResult();
|
||||||
|
}
|
||||||
// Check if user has the
|
// Check if user has the
|
||||||
if (!challenge.getLevel().equals(ChallengesManager.FREE) && !manager.isLevelUnlocked(user, challenge.getLevel(), world)) {
|
if (!challenge.getLevel().equals(ChallengesManager.FREE) && !manager.isLevelUnlocked(user, challenge.getLevel(), world)) {
|
||||||
user.sendMessage("challenges.errors.challenge-level-not-available");
|
user.sendMessage("challenges.errors.challenge-level-not-available");
|
||||||
|
Loading…
Reference in New Issue
Block a user