9
0
mirror of https://github.com/Auxilor/EcoMobs.git synced 2025-12-22 16:39:25 +00:00

Added extension support

This commit is contained in:
Auxilor
2021-04-14 12:53:28 +01:00
parent 4ee1e95d0e
commit f3dd440def

View File

@@ -43,6 +43,15 @@ public class EcoBossesPlugin extends EcoPlugin {
*/ */
@Override @Override
public void enable() { public void enable() {
this.getExtensionLoader().loadExtensions();
if (this.getExtensionLoader().getLoadedExtensions().isEmpty()) {
this.getLogger().info("&cNo extensions found");
} else {
this.getLogger().info("Extensions Loaded:");
this.getExtensionLoader().getLoadedExtensions().forEach(extension -> this.getLogger().info("- " + extension.getName() + " v" + extension.getVersion()));
}
this.getScheduler().runTimer(new AutoSpawnTimer(), 5, 1); this.getScheduler().runTimer(new AutoSpawnTimer(), 5, 1);
} }
@@ -51,6 +60,8 @@ public class EcoBossesPlugin extends EcoPlugin {
*/ */
@Override @Override
public void disable() { public void disable() {
this.getExtensionLoader().unloadExtensions();
for (EcoBoss boss : EcoBosses.values()) { for (EcoBoss boss : EcoBosses.values()) {
for (UUID uuid : boss.getLivingBosses().keySet()) { for (UUID uuid : boss.getLivingBosses().keySet()) {
LivingEntity entity = (LivingEntity) Bukkit.getEntity(uuid); LivingEntity entity = (LivingEntity) Bukkit.getEntity(uuid);