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 {
private AddonDescription description;
private boolean enabled;
private AddonState state;
public abstract void enable();
public abstract void disable();
@ -13,11 +13,8 @@ public abstract class BSAddon {
return description;
}
public boolean isEnabled() {
return enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
public AddonState getState() { return state; }
public boolean isEnabled() { return state == AddonState.ENABLED; }
public boolean isDisabled() { return state == AddonState.DISABLED; }
public boolean isIncompatible() { return state == AddonState.INCOMPATIBLE; }
}