Addons API - Added AddonState

This commit is contained in:
Florian CUNY 2017-12-11 21:01:49 +01:00
parent 0d2eb51f5d
commit 3196b0b962
2 changed files with 15 additions and 8 deletions

View File

@ -0,0 +1,10 @@
package us.tastybento.bskyblock.api.addons;
public enum AddonState {
LOADING,
ENABLING,
ENABLED,
DISABLING,
DISABLED,
INCOMPATIBLE
}

View File

@ -3,7 +3,7 @@ package us.tastybento.bskyblock.api.addons;
public abstract class BSAddon { public abstract class BSAddon {
private AddonDescription description; private AddonDescription description;
private boolean enabled; private AddonState state;
public abstract void enable(); public abstract void enable();
public abstract void disable(); public abstract void disable();
@ -13,11 +13,8 @@ public abstract class BSAddon {
return description; return description;
} }
public boolean isEnabled() { public AddonState getState() { return state; }
return enabled; public boolean isEnabled() { return state == AddonState.ENABLED; }
} public boolean isDisabled() { return state == AddonState.DISABLED; }
public boolean isIncompatible() { return state == AddonState.INCOMPATIBLE; }
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
} }