Fixed extensions for Spells and Artifacts

This commit is contained in:
Auxilor
2020-11-20 18:01:25 +00:00
parent fbe5c99853
commit a66637d2ec
4 changed files with 13 additions and 4 deletions

View File

@@ -34,7 +34,11 @@ public abstract class Artifact extends EcoEnchant {
private Particle.DustOptions extra;
protected Artifact(String key, Prerequisite... prerequisites) {
super(key, EnchantmentType.ARTIFACT, prerequisites);
this(key, EcoEnchantsPlugin.class, prerequisites);
}
protected Artifact(String key, Class<?> plugin, Prerequisite... prerequisites) {
super(key, EnchantmentType.ARTIFACT, plugin, prerequisites);
if(!Prerequisite.areMet(prerequisites)) {
HandlerList.unregisterAll(this); // Prevent events firing
@@ -43,6 +47,7 @@ public abstract class Artifact extends EcoEnchant {
this.particle = this.getParticle();
this.extra = this.getDustOptions();
}
protected abstract Particle getParticle();

View File

@@ -36,7 +36,11 @@ public abstract class Spell extends EcoEnchant {
);
protected Spell(String key, Prerequisite... prerequisites) {
super(key, EnchantmentType.SPELL, prerequisites);
this(key, EcoEnchantsPlugin.class, prerequisites);
}
protected Spell(String key, Class<?> plugin, Prerequisite... prerequisites) {
super(key, EnchantmentType.SPELL, plugin, prerequisites);
}
public int getCooldownTime() {