From 327f0ce7c471ee7b204e19e8408f1ce715573f79 Mon Sep 17 00:00:00 2001 From: "main()" Date: Mon, 12 Dec 2011 20:57:41 +0100 Subject: [PATCH] Pulled some methods up into the Core-interface (amended, sorry) --- .../MultiverseCore/MultiverseCore.java | 45 ++++++-------- .../onarandombox/MultiverseCore/api/Core.java | 58 +++++++++++++++++++ 2 files changed, 76 insertions(+), 27 deletions(-) diff --git a/src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java b/src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java index 87dae0d3..2a5429cf 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java +++ b/src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java @@ -303,7 +303,7 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core { } /** - * Load the Configuration files OR create the default config files. + * {@inheritDoc} */ @Override public void loadConfigs() { @@ -466,11 +466,10 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core { } /** - * Parse the Authors Array into a readable String with ',' and 'and'. - * - * @return The readable authors-{@link String} + * {@inheritDoc} */ - private String getAuthors() { + @Override + public String getAuthors() { String authors = ""; ArrayList auths = this.getDescription().getAuthors(); if (auths.size() == 0) { @@ -554,42 +553,41 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core { } /** - * Returns the number of plugins that have specifically hooked into core. - * - * @return The number if plugins that have hooked into core. + * {@inheritDoc} */ + @Override public int getPluginCount() { return this.pluginCount; } /** - * Increments the number of plugins that have specifically hooked into core. + * {@inheritDoc} */ + @Override public void incrementPluginCount() { this.pluginCount += 1; } /** - * Decrements the number of plugins that have specifically hooked into core. + * {@inheritDoc} */ + @Override public void decrementPluginCount() { this.pluginCount -= 1; } /** - * Gets this plugin's {@link AllPay}-Banker. - * - * @return An {@link AllPay}-Banker + * {@inheritDoc} */ + @Override public AllPay getBanker() { return this.banker; } /** - * Sets this plugin's {@link AllPay}-Banker. - * - * @param bank The new {@link AllPay}-Banker + * {@inheritDoc} */ + @Override public void setBank(GenericBank bank) { this.bank = bank; } @@ -710,15 +708,9 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core { } /** - * Used by queued commands to regenerate a world on a delay. - * - * @param name Name of the world to regenerate - * @param useNewSeed If a new seed should be used - * @param randomSeed IF the new seed should be random - * @param seed The seed of the world. - * - * @return True if success, false if fail. + * {@inheritDoc} */ + @Override public Boolean regenWorld(String name, Boolean useNewSeed, Boolean randomSeed, String seed) { MultiverseWorld world = this.worldManager.getMVWorld(name); if (world == null) { @@ -750,10 +742,9 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core { } /** - * Gets the {@link AnchorManager}. - * - * @return The {@link AnchorManager} + * {@inheritDoc} */ + @Override public AnchorManager getAnchorManager() { return this.anchorManager; } diff --git a/src/main/java/com/onarandombox/MultiverseCore/api/Core.java b/src/main/java/com/onarandombox/MultiverseCore/api/Core.java index 11e4a863..7eec0ba2 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/api/Core.java +++ b/src/main/java/com/onarandombox/MultiverseCore/api/Core.java @@ -7,6 +7,7 @@ package com.onarandombox.MultiverseCore.api; +import com.fernferret.allpay.AllPay; import com.fernferret.allpay.GenericBank; import com.onarandombox.MultiverseCore.destination.DestinationFactory; import com.onarandombox.MultiverseCore.utils.*; @@ -105,4 +106,61 @@ public interface Core { * @return Whether the config was successfully saved */ boolean saveMVConfigs(); + + /** + * Gets the {@link AnchorManager}. + * + * @return The {@link AnchorManager} + */ + AnchorManager getAnchorManager(); + + /** + * Used by queued commands to regenerate a world on a delay. + * + * @param name Name of the world to regenerate + * @param useNewSeed If a new seed should be used + * @param randomSeed IF the new seed should be random + * @param seed The seed of the world. + * + * @return True if success, false if fail. + */ + Boolean regenWorld(String name, Boolean useNewSeed, Boolean randomSeed, String seed); + + /** + * Sets the {@link GenericBank}-Bank AllPay is using. + * + * @param bank The new {@link GenericBank} + */ + void setBank(GenericBank bank); + + /** + * Gets this plugin's {@link AllPay}-Banker. + * + * @return An {@link AllPay}-Banker + */ + AllPay getBanker(); + + /** + * Decrements the number of plugins that have specifically hooked into core. + */ + void decrementPluginCount(); + + /** + * Increments the number of plugins that have specifically hooked into core. + */ + void incrementPluginCount(); + + /** + * Returns the number of plugins that have specifically hooked into core. + * + * @return The number if plugins that have hooked into core. + */ + int getPluginCount(); + + /** + * Parse the Authors Array into a readable String with ',' and 'and'. + * + * @return The readable authors-{@link String} + */ + String getAuthors(); }