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.commands.CompositeCommand;
|
||||||
import world.bentobox.bentobox.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
import world.bentobox.challenges.ChallengesAddon;
|
import world.bentobox.challenges.ChallengesAddon;
|
||||||
import world.bentobox.challenges.panel.user.ChallengesGUI;
|
import world.bentobox.challenges.panel.user.ChallengesPanel;
|
||||||
|
|
||||||
|
|
||||||
public class ChallengesCommand extends CompositeCommand
|
public class ChallengesCommand extends CompositeCommand
|
||||||
@ -70,11 +70,12 @@ public class ChallengesCommand extends CompositeCommand
|
|||||||
// Open up the challenges GUI
|
// Open up the challenges GUI
|
||||||
if (user.isPlayer())
|
if (user.isPlayer())
|
||||||
{
|
{
|
||||||
new ChallengesGUI((ChallengesAddon) this.getAddon(),
|
ChallengesPanel.open(this.getAddon(),
|
||||||
this.getWorld(),
|
this.getWorld(),
|
||||||
user,
|
user,
|
||||||
this.getTopLabel(),
|
this.getTopLabel(),
|
||||||
this.getPermissionPrefix()).build();
|
this.getPermissionPrefix());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// Show help
|
// Show help
|
||||||
|
@ -8,7 +8,7 @@ import world.bentobox.bentobox.api.commands.CompositeCommand;
|
|||||||
import world.bentobox.bentobox.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
import world.bentobox.challenges.ChallengesAddon;
|
import world.bentobox.challenges.ChallengesAddon;
|
||||||
import world.bentobox.challenges.config.SettingsUtils.GuiMode;
|
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)
|
else if (this.addon.getChallengesSettings().getUserGuiMode() == GuiMode.GAMEMODE_LIST)
|
||||||
{
|
{
|
||||||
new GameModesGUI(this.addon,
|
GameModePanel.open(this.addon,
|
||||||
this.getWorld(),
|
this.getWorld(),
|
||||||
user,
|
user,
|
||||||
this.getTopLabel(),
|
this.gameModeAddons,
|
||||||
this.getPermissionPrefix(),
|
false);
|
||||||
false,
|
|
||||||
this.gameModeAddons).build();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,10 +95,10 @@ public class ChallengesUserCommand extends CompositeCommand
|
|||||||
/**
|
/**
|
||||||
* List with hooked GameMode addons.
|
* List with hooked GameMode addons.
|
||||||
*/
|
*/
|
||||||
private List<GameModeAddon> gameModeAddons;
|
private final List<GameModeAddon> gameModeAddons;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Challenges addon for easier operations.
|
* 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.commands.CompositeCommand;
|
||||||
import world.bentobox.bentobox.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
import world.bentobox.challenges.ChallengesAddon;
|
import world.bentobox.challenges.ChallengesAddon;
|
||||||
import world.bentobox.challenges.panel.admin.AdminGUI;
|
import world.bentobox.challenges.panel.admin.AdminPanel;
|
||||||
|
|
||||||
|
|
||||||
public class Challenges extends CompositeCommand
|
public class Challenges extends CompositeCommand
|
||||||
@ -55,11 +55,11 @@ public class Challenges extends CompositeCommand
|
|||||||
// Open up the admin challenges GUI
|
// Open up the admin challenges GUI
|
||||||
if (user.isPlayer())
|
if (user.isPlayer())
|
||||||
{
|
{
|
||||||
new AdminGUI((ChallengesAddon) this.getAddon(),
|
AdminPanel.open(this.getAddon(),
|
||||||
this.getWorld(),
|
this.getWorld(),
|
||||||
user,
|
user,
|
||||||
this.getTopLabel(),
|
this.getTopLabel(),
|
||||||
this.getPermissionPrefix()).build();
|
this.getPermissionPrefix());
|
||||||
|
|
||||||
return true;
|
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.commands.CompositeCommand;
|
||||||
import world.bentobox.bentobox.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
import world.bentobox.challenges.ChallengesAddon;
|
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
|
else
|
||||||
{
|
{
|
||||||
new GameModesGUI(this.addon,
|
GameModePanel.open(this.addon,
|
||||||
this.getWorld(),
|
this.getWorld(),
|
||||||
user,
|
user,
|
||||||
this.getTopLabel(),
|
this.gameModeAddons,
|
||||||
this.getPermissionPrefix(),
|
true);
|
||||||
true,
|
|
||||||
this.gameModeAddons).build();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -78,10 +76,10 @@ public class ChallengesAdminCommand extends CompositeCommand
|
|||||||
/**
|
/**
|
||||||
* This variable stores challenges addon.
|
* 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.
|
* 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