Skip to content

Commit

Permalink
Move some methods out of config and check properly if movecraft class…
Browse files Browse the repository at this point in the history
…es are present
  • Loading branch information
Intybyte committed Dec 4, 2024
1 parent 1a281dd commit 9fa4587
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
20 changes: 17 additions & 3 deletions cannons-bukkit/src/main/java/at/pavlov/cannons/Cannons.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,19 @@ public static Cannons getPlugin() {

public void onLoad() {
//must be done in onLoad because "movecraft"
this.config = new Config(this);

if (!config.isMovecraftEnabled()) {
return;
}

try {
MaxCannonsProperty.register();
} catch (Exception ignored) {}
Class.forName("net.countercraft.movecraft.craft.type.property.Property");
} catch (Exception ignored) {
return;
}

MaxCannonsProperty.register();
}

public void onDisable() {
Expand Down Expand Up @@ -118,10 +128,14 @@ public void onDisable() {
public void onEnable()
{
DesignStorage.initialize(this);
this.config = new Config(this);
ProjectileManager.initialize(this);
CannonSelector.initialize(this);

DesignStorage.getInstance().loadCannonDesigns();
config.getProjectileStorage().loadProjectiles();
config.getCannonManager().updateCannons();
config.getUserMessage().loadLanguage();

pm = getServer().getPluginManager();
if (!checkWorldEdit())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,7 @@ public void loadConfig()
setCancelItems(ParseUtils.toItemHolderList(config.getStringList("cancelEventForLoadingItem")));

//load other configs
DesignStorage.getInstance().loadCannonDesigns();
projectileStorage.loadProjectiles();
cannonManager.updateCannons();
userMessage.loadLanguage();

plugin.setDebugMode(debugMode);
}

Expand Down

0 comments on commit 9fa4587

Please sign in to comment.