mirror of
https://github.com/BentoBoxWorld/Challenges.git
synced 2024-11-24 19:45:14 +01:00
Update commands.
Commands will now call correct GUI.
This commit is contained in:
parent
d1f15aed8b
commit
bfc5cefd69
@ -6,7 +6,7 @@ import world.bentobox.bentobox.api.addons.GameModeAddon;
|
||||
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||
import world.bentobox.bentobox.api.user.User;
|
||||
import world.bentobox.challenges.ChallengesAddon;
|
||||
import world.bentobox.challenges.panel.user.ChallengesGUI;
|
||||
import world.bentobox.challenges.panel.user.ChallengesPanel;
|
||||
|
||||
|
||||
public class ChallengesCommand extends CompositeCommand
|
||||
@ -70,11 +70,12 @@ public class ChallengesCommand extends CompositeCommand
|
||||
// Open up the challenges GUI
|
||||
if (user.isPlayer())
|
||||
{
|
||||
new ChallengesGUI((ChallengesAddon) this.getAddon(),
|
||||
this.getWorld(),
|
||||
user,
|
||||
this.getTopLabel(),
|
||||
this.getPermissionPrefix()).build();
|
||||
ChallengesPanel.open(this.getAddon(),
|
||||
this.getWorld(),
|
||||
user,
|
||||
this.getTopLabel(),
|
||||
this.getPermissionPrefix());
|
||||
|
||||
return true;
|
||||
}
|
||||
// Show help
|
||||
|
@ -8,7 +8,7 @@ import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||
import world.bentobox.bentobox.api.user.User;
|
||||
import world.bentobox.challenges.ChallengesAddon;
|
||||
import world.bentobox.challenges.config.SettingsUtils.GuiMode;
|
||||
import world.bentobox.challenges.panel.GameModesGUI;
|
||||
import world.bentobox.challenges.panel.user.GameModePanel;
|
||||
|
||||
|
||||
/**
|
||||
@ -75,13 +75,11 @@ public class ChallengesUserCommand extends CompositeCommand
|
||||
}
|
||||
else if (this.addon.getChallengesSettings().getUserGuiMode() == GuiMode.GAMEMODE_LIST)
|
||||
{
|
||||
new GameModesGUI(this.addon,
|
||||
GameModePanel.open(this.addon,
|
||||
this.getWorld(),
|
||||
user,
|
||||
this.getTopLabel(),
|
||||
this.getPermissionPrefix(),
|
||||
false,
|
||||
this.gameModeAddons).build();
|
||||
this.gameModeAddons,
|
||||
false);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -97,10 +95,10 @@ public class ChallengesUserCommand extends CompositeCommand
|
||||
/**
|
||||
* List with hooked GameMode addons.
|
||||
*/
|
||||
private List<GameModeAddon> gameModeAddons;
|
||||
private final List<GameModeAddon> gameModeAddons;
|
||||
|
||||
/**
|
||||
* Challenges addon for easier operations.
|
||||
*/
|
||||
private ChallengesAddon addon;
|
||||
private final ChallengesAddon addon;
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import java.util.List;
|
||||
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||
import world.bentobox.bentobox.api.user.User;
|
||||
import world.bentobox.challenges.ChallengesAddon;
|
||||
import world.bentobox.challenges.panel.admin.AdminGUI;
|
||||
import world.bentobox.challenges.panel.admin.AdminPanel;
|
||||
|
||||
|
||||
public class Challenges extends CompositeCommand
|
||||
@ -55,11 +55,11 @@ public class Challenges extends CompositeCommand
|
||||
// Open up the admin challenges GUI
|
||||
if (user.isPlayer())
|
||||
{
|
||||
new AdminGUI((ChallengesAddon) this.getAddon(),
|
||||
AdminPanel.open(this.getAddon(),
|
||||
this.getWorld(),
|
||||
user,
|
||||
this.getTopLabel(),
|
||||
this.getPermissionPrefix()).build();
|
||||
this.getPermissionPrefix());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import world.bentobox.bentobox.api.addons.GameModeAddon;
|
||||
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||
import world.bentobox.bentobox.api.user.User;
|
||||
import world.bentobox.challenges.ChallengesAddon;
|
||||
import world.bentobox.challenges.panel.GameModesGUI;
|
||||
import world.bentobox.challenges.panel.user.GameModePanel;
|
||||
|
||||
|
||||
/**
|
||||
@ -58,13 +58,11 @@ public class ChallengesAdminCommand extends CompositeCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
new GameModesGUI(this.addon,
|
||||
GameModePanel.open(this.addon,
|
||||
this.getWorld(),
|
||||
user,
|
||||
this.getTopLabel(),
|
||||
this.getPermissionPrefix(),
|
||||
true,
|
||||
this.gameModeAddons).build();
|
||||
this.gameModeAddons,
|
||||
true);
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -78,10 +76,10 @@ public class ChallengesAdminCommand extends CompositeCommand
|
||||
/**
|
||||
* This variable stores challenges addon.
|
||||
*/
|
||||
private ChallengesAddon addon;
|
||||
private final ChallengesAddon addon;
|
||||
|
||||
/**
|
||||
* This variable stores List with game modes where challenges addon are hooked in.
|
||||
*/
|
||||
private List<GameModeAddon> gameModeAddons;
|
||||
private final List<GameModeAddon> gameModeAddons;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user