From d776f6a90bca9a9ec3e1c84a48974a207dd1f636 Mon Sep 17 00:00:00 2001 From: Florian CUNY Date: Sun, 10 Dec 2017 21:42:04 +0100 Subject: [PATCH] Addons API - Introducing foundations of this API. WIP --- .../api/addons/AddonDescription.java | 40 +++++++++++++++++++ .../bskyblock/api/addons/AddonManager.java | 13 ++++++ .../bskyblock/api/addons/BSAddon.java | 23 +++++++++++ 3 files changed, 76 insertions(+) create mode 100644 src/main/java/us/tastybento/bskyblock/api/addons/AddonDescription.java create mode 100644 src/main/java/us/tastybento/bskyblock/api/addons/AddonManager.java create mode 100644 src/main/java/us/tastybento/bskyblock/api/addons/BSAddon.java diff --git a/src/main/java/us/tastybento/bskyblock/api/addons/AddonDescription.java b/src/main/java/us/tastybento/bskyblock/api/addons/AddonDescription.java new file mode 100644 index 000000000..8c68def6a --- /dev/null +++ b/src/main/java/us/tastybento/bskyblock/api/addons/AddonDescription.java @@ -0,0 +1,40 @@ +package us.tastybento.bskyblock.api.addons; + +import java.util.List; + +public final class AddonDescription { + + private String main; + private String name; + private String version; + private String description; + private List authors; + + public AddonDescription(String main, String name, String version, String description, List authors) { + this.main = main; + this.name = name; + this.version = version; + this.description = description; + this.authors = authors; + } + + public String getName() { + return name; + } + + public String getMain() { + return main; + } + + public String getVersion() { + return version; + } + + public String getDescription() { + return description; + } + + public List getAuthors() { + return authors; + } +} diff --git a/src/main/java/us/tastybento/bskyblock/api/addons/AddonManager.java b/src/main/java/us/tastybento/bskyblock/api/addons/AddonManager.java new file mode 100644 index 000000000..6f074e1ed --- /dev/null +++ b/src/main/java/us/tastybento/bskyblock/api/addons/AddonManager.java @@ -0,0 +1,13 @@ +package us.tastybento.bskyblock.api.addons; + +import java.util.ArrayList; +import java.util.List; + +public final class AddonManager { + + private final List addons = new ArrayList<>(); + + public List getAddons() { + return addons; + } +} diff --git a/src/main/java/us/tastybento/bskyblock/api/addons/BSAddon.java b/src/main/java/us/tastybento/bskyblock/api/addons/BSAddon.java new file mode 100644 index 000000000..0cc210043 --- /dev/null +++ b/src/main/java/us/tastybento/bskyblock/api/addons/BSAddon.java @@ -0,0 +1,23 @@ +package us.tastybento.bskyblock.api.addons; + +public abstract class BSAddon { + + private AddonDescription description; + private boolean enabled; + + public abstract void enable(); + public abstract void disable(); + public abstract void load(); + + public AddonDescription getDescription() { + return description; + } + + public boolean isEnabled() { + return enabled; + } + + public void setEnabled(boolean enabled) { + this.enabled = enabled; + } +}