mirror of
https://github.com/BentoBoxWorld/Challenges.git
synced 2024-11-13 06:05:46 +01:00
Update to new API
This commit is contained in:
parent
b75ec5d12b
commit
2d25850b3a
@ -21,7 +21,7 @@ public class ChallengesAddon extends Addon {
|
||||
@Override
|
||||
public void onEnable() {
|
||||
// Check if it is enabled - it might be loaded, but not enabled.
|
||||
if (getBSkyBlock() == null || !getBSkyBlock().isEnabled()) {
|
||||
if (getPlugin() == null || !getPlugin().isEnabled()) {
|
||||
Bukkit.getLogger().severe("BSkyBlock is not available or disabled!");
|
||||
this.setEnabled(false);
|
||||
return;
|
||||
@ -34,21 +34,21 @@ public class ChallengesAddon extends Addon {
|
||||
|
||||
// Register commands - run one tick later to allow all addons to load
|
||||
// AcidIsland hook in
|
||||
getServer().getScheduler().runTask(getBSkyBlock(), () -> {
|
||||
this.getBSkyBlock().getAddonsManager().getAddonByName("AcidIsland").ifPresent(a -> {
|
||||
CompositeCommand acidIslandCmd = getBSkyBlock().getCommandsManager().getCommand("ai");
|
||||
getServer().getScheduler().runTask(getPlugin(), () -> {
|
||||
this.getPlugin().getAddonsManager().getAddonByName("AcidIsland").ifPresent(a -> {
|
||||
CompositeCommand acidIslandCmd = getPlugin().getCommandsManager().getCommand("ai");
|
||||
if (acidIslandCmd != null) {
|
||||
new ChallengesCommand(this, acidIslandCmd);
|
||||
CompositeCommand acidCmd = getBSkyBlock().getCommandsManager().getCommand("acid");
|
||||
CompositeCommand acidCmd = getPlugin().getCommandsManager().getCommand("acid");
|
||||
new ChallengesAdminImportCommand(this, acidCmd);
|
||||
}
|
||||
});
|
||||
this.getBSkyBlock().getAddonsManager().getAddonByName("BSkyBlock").ifPresent(a -> {
|
||||
this.getPlugin().getAddonsManager().getAddonByName("BSkyBlock").ifPresent(a -> {
|
||||
// BSkyBlock hook in
|
||||
CompositeCommand bsbIslandCmd = getBSkyBlock().getCommandsManager().getCommand("island");
|
||||
CompositeCommand bsbIslandCmd = getPlugin().getCommandsManager().getCommand("island");
|
||||
if (bsbIslandCmd != null) {
|
||||
new ChallengesCommand(this, bsbIslandCmd);
|
||||
CompositeCommand bsbAdminCmd = getBSkyBlock().getCommandsManager().getCommand("bsbadmin");
|
||||
CompositeCommand bsbAdminCmd = getPlugin().getCommandsManager().getCommand("bsbadmin");
|
||||
new ChallengesAdminImportCommand(this, bsbAdminCmd);
|
||||
}
|
||||
});
|
||||
|
@ -356,7 +356,7 @@ public class ChallengesManager {
|
||||
*/
|
||||
public void save(boolean async) {
|
||||
if (async) {
|
||||
addon.getServer().getScheduler().runTaskAsynchronously(addon.getBSkyBlock(), this::save);
|
||||
addon.getServer().getScheduler().runTaskAsynchronously(addon.getPlugin(), this::save);
|
||||
} else {
|
||||
save();
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ public class CreateSurrounding extends CompositeCommand implements Listener {
|
||||
public CreateSurrounding(ChallengesAddon addon, CompositeCommand parent) {
|
||||
super(parent, "surrounding");
|
||||
this.addon = addon;
|
||||
addon.getServer().getPluginManager().registerEvents(this, addon.getBSkyBlock());
|
||||
addon.getServer().getPluginManager().registerEvents(this, addon.getPlugin());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -218,7 +218,7 @@ public class ChallengesPanels {
|
||||
if (expReward > 0) {
|
||||
result.addAll(splitTrans(user,"challenges.exp-reward", "[reward]", String.valueOf(expReward)));
|
||||
}
|
||||
if (addon.getBSkyBlock().getSettings().isUseEconomy() && moneyReward > 0) {
|
||||
if (addon.getPlugin().getSettings().isUseEconomy() && moneyReward > 0) {
|
||||
result.addAll(splitTrans(user,"challenges.money-reward", "[reward]", String.valueOf(moneyReward)));
|
||||
}
|
||||
// Final placeholder change for [label]
|
||||
|
Loading…
Reference in New Issue
Block a user