diff --git a/src/me/staartvin/plugins/pluginlibrary/PluginLibrary.java b/src/me/staartvin/plugins/pluginlibrary/PluginLibrary.java index 4ede7b8..3331c43 100644 --- a/src/me/staartvin/plugins/pluginlibrary/PluginLibrary.java +++ b/src/me/staartvin/plugins/pluginlibrary/PluginLibrary.java @@ -1,164 +1,165 @@ -package me.staartvin.plugins.pluginlibrary; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import me.staartvin.plugins.pluginlibrary.hooks.LibraryHook; -import me.staartvin.plugins.pluginlibrary.hooks.customstats.CustomStatsManager; -import net.md_5.bungee.api.ChatColor; - -import org.bukkit.plugin.java.JavaPlugin; - -/** - * Main class of PluginLibrary - *
- * Date created: 14:06:30 12 aug. 2015
- *
- * @author Staartvin
- *
- */
-public class PluginLibrary extends JavaPlugin {
-
- private final List
+ * Date created: 14:06:30 12 aug. 2015
+ *
+ * @author Staartvin
+ *
+ */
+public class PluginLibrary extends JavaPlugin {
+
+ private final List
- * This list is unmodifiable and when you try to alter it, it will give an
- * {@link UnsupportedOperationException}.
- *
- * @return a list of loaded libraries.
- */
- public List
- * Will throw a {@link IllegalArgumentException} when there is no library
- * with the given name.
- *
- * @param pluginName Name of the plugin. Case-insensitive!
- * @return {@link me.staartvin.plugins.pluginlibrary.LibraryHook} class or
- * an error.
- */
- public static LibraryHook getLibrary(String pluginName) {
- return Library.getEnum(pluginName).getHook();
- }
-
- /**
- * @see #getLibrary(String)
- *
- * Returns the same as {@link #getLibrary(String)}.
- * @param lib Library enum to get the library hook for.
- * @return {@link me.staartvin.plugins.pluginlibrary.LibraryHook} class or
- * an error.
- */
- public static LibraryHook getLibrary(Library lib) {
- return lib.getHook();
- }
-
- /**
- * Checks to see whether the library is loaded and thus ready for use.
- *
- * @param lib Library to check.
- * @return true if the library is loaded; false otherwise.
- */
- public boolean isLibraryLoaded(Library lib) {
- return loadedLibraries.contains(lib);
- }
-
- public CustomStatsManager getCustomStatsManager() {
- return customStatsManager;
- }
-
- public void setCustomStatsManager(CustomStatsManager customStatsManager) {
- this.customStatsManager = customStatsManager;
- }
-
- private String getLoadedLibrariesAsString() {
- StringBuilder builder = new StringBuilder("");
-
- for (int i = 0, l = loadedLibraries.size(); i < l; i++) {
- if (i == 0) {
- builder.append(ChatColor.DARK_AQUA
- + loadedLibraries.get(i).getPluginName() + ChatColor.RESET);
- } else if (i == (l - 1)) {
- builder.append(ChatColor.GRAY
- + " and "
- + (ChatColor.DARK_AQUA
- + loadedLibraries.get(i).getPluginName() + ChatColor.RESET));
- } else {
- builder.append(ChatColor.GRAY
- + ", "
- + (ChatColor.DARK_AQUA
- + loadedLibraries.get(i).getPluginName() + ChatColor.RESET));
- }
- }
-
- return builder.toString();
- }
-}
+package me.staartvin.plugins.pluginlibrary;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import me.staartvin.plugins.pluginlibrary.hooks.LibraryHook;
+import me.staartvin.plugins.pluginlibrary.hooks.customstats.CustomStatsManager;
+import net.md_5.bungee.api.ChatColor;
+
+import org.bukkit.plugin.java.JavaPlugin;
+
+/**
+ * Main class of PluginLibrary
+ *
+ * This list is unmodifiable and when you try to alter it, it will give an
+ * {@link UnsupportedOperationException}.
+ *
+ * @return a list of loaded libraries.
+ */
+ public List
+ * Will throw a {@link IllegalArgumentException} when there is no library
+ * with the given name.
+ *
+ * @param pluginName Name of the plugin. Case-insensitive!
+ * @return {@link me.staartvin.plugins.pluginlibrary.LibraryHook} class or
+ * an error.
+ */
+ public static LibraryHook getLibrary(String pluginName) {
+ return Library.getEnum(pluginName).getHook();
+ }
+
+ /**
+ * @see #getLibrary(String)
+ *
+ * Returns the same as {@link #getLibrary(String)}.
+ * @param lib Library enum to get the library hook for.
+ * @return {@link me.staartvin.plugins.pluginlibrary.LibraryHook} class or
+ * an error.
+ */
+ public static LibraryHook getLibrary(Library lib) {
+ return lib.getHook();
+ }
+
+ /**
+ * Checks to see whether the library is loaded and thus ready for use.
+ *
+ * @param lib Library to check.
+ * @return true if the library is loaded; false otherwise.
+ */
+ public boolean isLibraryLoaded(Library lib) {
+ return loadedLibraries.contains(lib);
+ }
+
+ public CustomStatsManager getCustomStatsManager() {
+ return customStatsManager;
+ }
+
+ public void setCustomStatsManager(CustomStatsManager customStatsManager) {
+ this.customStatsManager = customStatsManager;
+ }
+
+ private String getLoadedLibrariesAsString() {
+ StringBuilder builder = new StringBuilder("");
+
+ for (int i = 0, l = loadedLibraries.size(); i < l; i++) {
+ if (i == 0) {
+ builder.append(ChatColor.DARK_AQUA
+ + loadedLibraries.get(i).getPluginName() + ChatColor.RESET);
+ } else if (i == (l - 1)) {
+ builder.append(ChatColor.GRAY
+ + " and "
+ + (ChatColor.DARK_AQUA
+ + loadedLibraries.get(i).getPluginName() + ChatColor.RESET));
+ } else {
+ builder.append(ChatColor.GRAY
+ + ", "
+ + (ChatColor.DARK_AQUA
+ + loadedLibraries.get(i).getPluginName() + ChatColor.RESET));
+ }
+ }
+
+ return builder.toString();
+ }
+}