mirror of
https://github.com/BentoBoxWorld/Challenges.git
synced 2024-11-28 05:25:21 +01:00
Fix issue when users could open challenges gui, even if challenges in that world does not exist (#69)
This commit is contained in:
parent
ecc7c976c4
commit
fa03ea0669
@ -73,6 +73,14 @@ public class ChallengesGUI extends CommonGUI
|
||||
@Override
|
||||
public void build()
|
||||
{
|
||||
// Do not open gui if there is no challenges.
|
||||
if (this.challengesManager.getAllChallenges(this.world).isEmpty())
|
||||
{
|
||||
this.addon.getLogger().severe("There are no challenges set up!");
|
||||
this.user.sendMessage("general.errors.general");
|
||||
return;
|
||||
}
|
||||
|
||||
PanelBuilder panelBuilder = new PanelBuilder().user(this.user).
|
||||
name(this.user.getTranslation("challenges.gui.title"));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user