Add completion blockage for un-deployed challenges.

This commit is contained in:
BONNe 2019-01-26 13:58:00 +02:00
parent 2a6127b0f6
commit d6a39b2600
2 changed files with 7 additions and 1 deletions

View File

@ -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");

View File

@ -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.