mirror of
https://github.com/BentoBoxWorld/Challenges.git
synced 2025-01-01 13:57:45 +01:00
Update to BentoBox 1.2
For users who are not ready to use unfinished Challenges 0.5
This commit is contained in:
parent
4c3026f3c1
commit
fbe7f1579a
@ -41,27 +41,20 @@ public class ChallengesAddon extends Addon {
|
|||||||
// Challenge import setup
|
// Challenge import setup
|
||||||
importManager = new FreshSqueezedChallenges(this);
|
importManager = new FreshSqueezedChallenges(this);
|
||||||
|
|
||||||
// Register commands - run one tick later to allow all addons to load
|
this.getPlugin().getAddonsManager().getGameModeAddons().forEach(gameModeAddon -> {
|
||||||
// AcidIsland hook in
|
if (gameModeAddon.getPlayerCommand().isPresent())
|
||||||
getPlugin().getAddonsManager().getAddonByName("AcidIsland").ifPresent(a -> {
|
{
|
||||||
CompositeCommand acidIslandCmd = getPlugin().getCommandsManager().getCommand("ai");
|
new ChallengesCommand(this, gameModeAddon.getPlayerCommand().get());
|
||||||
if (acidIslandCmd != null) {
|
this.hooked = true;
|
||||||
new ChallengesCommand(this, acidIslandCmd);
|
}
|
||||||
CompositeCommand acidCmd = getPlugin().getCommandsManager().getCommand("acid");
|
|
||||||
new Challenges(this, acidCmd);
|
if (gameModeAddon.getAdminCommand().isPresent())
|
||||||
hooked = true;
|
{
|
||||||
}
|
new Challenges(this, gameModeAddon.getAdminCommand().get());
|
||||||
});
|
this.hooked = true;
|
||||||
getPlugin().getAddonsManager().getAddonByName("BSkyBlock").ifPresent(a -> {
|
|
||||||
// BSkyBlock hook in
|
|
||||||
CompositeCommand bsbIslandCmd = getPlugin().getCommandsManager().getCommand("island");
|
|
||||||
if (bsbIslandCmd != null) {
|
|
||||||
new ChallengesCommand(this, bsbIslandCmd);
|
|
||||||
CompositeCommand bsbAdminCmd = getPlugin().getCommandsManager().getCommand("bsbadmin");
|
|
||||||
new Challenges(this, bsbAdminCmd);
|
|
||||||
hooked = true;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// If the add-on never hooks in, then it is useless
|
// If the add-on never hooks in, then it is useless
|
||||||
if (!hooked) {
|
if (!hooked) {
|
||||||
logError("Challenges could not hook into AcidIsland or BSkyBlock so will not do anything!");
|
logError("Challenges could not hook into AcidIsland or BSkyBlock so will not do anything!");
|
||||||
|
Loading…
Reference in New Issue
Block a user