use of com.voxelgameslib.voxelgameslib.components.kits.Kit in project VoxelGamesLibv2 by VoxelGamesLib.
the class KitFeature method enable.
/**
* @see AbstractFeature#enable()
*/
@Override
public void enable() {
if (registerCommands) {
commandManager.registerCommand(injector.getInstance(KitCommands.class));
}
if (allowedKits.size() == 0) {
allowedKits.add("DefaultKit");
}
// try to load kits
allowedKits.forEach(kit -> {
Optional<Kit> k = kitHandler.loadKit(kit);
if (k.isPresent()) {
kits.add(k.get());
} else {
log.warning("Could not find kit " + kit);
}
});
kits.forEach(kit -> {
if (kit.getAbilities() != null) {
for (Ability ability : kit.getAbilities().values()) {
Bukkit.getPluginManager().registerEvents(ability, voxelGamesLib);
}
}
});
}
Aggregations