Add proper message when user opens challenges gui in world without a challenges.

This commit is contained in:
BONNe 2019-05-01 23:18:12 +03:00
parent ca5cfcc841
commit a2f0765de1
2 changed files with 3 additions and 2 deletions

View File

@ -73,10 +73,10 @@ public class ChallengesGUI extends CommonGUI
public void build()
{
// Do not open gui if there is no challenges.
if (this.challengesManager.getAllChallenges(this.world).isEmpty())
if (!this.challengesManager.hasAnyChallengeData(this.world))
{
this.addon.getLogger().severe("There are no challenges set up!");
this.user.sendMessage("general.errors.general");
this.user.sendMessage("challenges.errors.no-challenges");
return;
}

View File

@ -358,6 +358,7 @@ challenges:
exist-challenges-or-levels: '&cIn your world already exist challenges. Cannot proceed!'
defaults-file-exist: '&cdefault.json already exists. Use overwrite mode to replace it!'
defaults-file-error: '&cThere was an error while creating default.json file! Check console!'
no-challenges: '&cChallenges are not implemented in current world!'
protection:
flags:
CHALLENGES_ISLAND_PROTECTION: