use of com.archyx.aureliumskills.skills.Skills in project AureliumSkills by Archy-X.
the class SkillsMenu method init.
public void init(Player player, InventoryContents contents) {
// Fill item
if (options.isFillEnabled()) {
contents.fill(ClickableItem.empty(options.getFillItem()));
}
// Close item
CloseItem closeItem = (CloseItem) options.getItem(ItemType.CLOSE);
contents.set(closeItem.getPos(), ClickableItem.of(closeItem.getItem(player, locale), e -> player.closeInventory()));
// Your skills item
YourSkillsItem yourSkillsItem = (YourSkillsItem) options.getItem(ItemType.YOUR_SKILLS);
contents.set(yourSkillsItem.getPos(), ClickableItem.empty(yourSkillsItem.getItem(player, locale)));
// Skill items
SkillTemplate skillTemplate = (SkillTemplate) options.getTemplate(TemplateType.SKILL);
if (OptionL.isEnabled(Skills.FARMING)) {
contents.set(skillTemplate.getPosition(Skills.FARMING), ClickableItem.of(skillTemplate.getItem(Skills.FARMING, playerData, player, locale), e -> open(player, playerData, Skills.FARMING)));
}
if (OptionL.isEnabled(Skills.FORAGING)) {
contents.set(skillTemplate.getPosition(Skills.FORAGING), ClickableItem.of(skillTemplate.getItem(Skills.FORAGING, playerData, player, locale), e -> open(player, playerData, Skills.FORAGING)));
}
if (OptionL.isEnabled(Skills.MINING)) {
contents.set(skillTemplate.getPosition(Skills.MINING), ClickableItem.of(skillTemplate.getItem(Skills.MINING, playerData, player, locale), e -> open(player, playerData, Skills.MINING)));
}
if (OptionL.isEnabled(Skills.FISHING)) {
contents.set(skillTemplate.getPosition(Skills.FISHING), ClickableItem.of(skillTemplate.getItem(Skills.FISHING, playerData, player, locale), e -> open(player, playerData, Skills.FISHING)));
}
if (OptionL.isEnabled(Skills.EXCAVATION)) {
contents.set(skillTemplate.getPosition(Skills.EXCAVATION), ClickableItem.of(skillTemplate.getItem(Skills.EXCAVATION, playerData, player, locale), e -> open(player, playerData, Skills.EXCAVATION)));
}
// Combat Skills
if (OptionL.isEnabled(Skills.ARCHERY)) {
contents.set(skillTemplate.getPosition(Skills.ARCHERY), ClickableItem.of(skillTemplate.getItem(Skills.ARCHERY, playerData, player, locale), e -> open(player, playerData, Skills.ARCHERY)));
}
if (OptionL.isEnabled(Skills.DEFENSE)) {
contents.set(skillTemplate.getPosition(Skills.DEFENSE), ClickableItem.of(skillTemplate.getItem(Skills.DEFENSE, playerData, player, locale), e -> open(player, playerData, Skills.DEFENSE)));
}
if (OptionL.isEnabled(Skills.FIGHTING)) {
contents.set(skillTemplate.getPosition(Skills.FIGHTING), ClickableItem.of(skillTemplate.getItem(Skills.FIGHTING, playerData, player, locale), e -> open(player, playerData, Skills.FIGHTING)));
}
if (OptionL.isEnabled(Skills.ENDURANCE)) {
contents.set(skillTemplate.getPosition(Skills.ENDURANCE), ClickableItem.of(skillTemplate.getItem(Skills.ENDURANCE, playerData, player, locale), e -> open(player, playerData, Skills.ENDURANCE)));
}
if (OptionL.isEnabled(Skills.AGILITY)) {
contents.set(skillTemplate.getPosition(Skills.AGILITY), ClickableItem.of(skillTemplate.getItem(Skills.AGILITY, playerData, player, locale), e -> open(player, playerData, Skills.AGILITY)));
}
// Magic Skills
if (OptionL.isEnabled(Skills.ALCHEMY)) {
contents.set(skillTemplate.getPosition(Skills.ALCHEMY), ClickableItem.of(skillTemplate.getItem(Skills.ALCHEMY, playerData, player, locale), e -> open(player, playerData, Skills.ALCHEMY)));
}
if (OptionL.isEnabled(Skills.ENCHANTING)) {
contents.set(skillTemplate.getPosition(Skills.ENCHANTING), ClickableItem.of(skillTemplate.getItem(Skills.ENCHANTING, playerData, player, locale), e -> open(player, playerData, Skills.ENCHANTING)));
}
if (OptionL.isEnabled(Skills.SORCERY)) {
contents.set(skillTemplate.getPosition(Skills.SORCERY), ClickableItem.of(skillTemplate.getItem(Skills.SORCERY, playerData, player, locale), e -> open(player, playerData, Skills.SORCERY)));
}
if (OptionL.isEnabled(Skills.HEALING)) {
contents.set(skillTemplate.getPosition(Skills.HEALING), ClickableItem.of(skillTemplate.getItem(Skills.HEALING, playerData, player, locale), e -> open(player, playerData, Skills.HEALING)));
}
if (OptionL.isEnabled(Skills.FORGING)) {
contents.set(skillTemplate.getPosition(Skills.FORGING), ClickableItem.of(skillTemplate.getItem(Skills.FORGING, playerData, player, locale), e -> open(player, playerData, Skills.FORGING)));
}
}
use of com.archyx.aureliumskills.skills.Skills in project MagicPlugin by elBukkit.
the class AureliumSkillsManager method load.
public void load(ConfigurationSection configuration) {
enabled = configuration.getBoolean("enabled", true);
useAttributes = enabled && configuration.getBoolean("use_attributes", true);
manaScale = configuration.getDouble("mana_scale", 1.0);
manaCostReduction = configuration.getDouble("mana_cost_reduction", 0.0);
registerCurrencies = enabled && configuration.getBoolean("use_xp_currencies", true);
if (manaScale <= 0) {
controller.getLogger().info("Invalid mana scale in aurelium_skills configuration: " + manaScale);
manaScale = 1;
}
boolean useMana = enabled && configuration.getBoolean("use_mana", true);
usesMana.clear();
if (useMana) {
usesMana.addAll(ConfigurationUtils.getStringList(configuration, "mana_classes"));
} else {
manaCostReduction = 0;
}
useMana = !usesMana.isEmpty();
xpEarnRates.clear();
ConfigurationSection earnRates = configuration.getConfigurationSection("xp_earn_from_sp");
for (String key : earnRates.getKeys(false)) {
try {
Skills skill = Skills.valueOf(key);
xpEarnRates.put(skill, earnRates.getDouble(key));
} catch (Exception ex) {
controller.getLogger().warning("Invalid AureliumSkills XP type in xp_earn_from_sp config: " + key);
}
}
String statusString;
if (!useMana && !useAttributes && !registerCurrencies) {
statusString = " but integration is disabled in configs";
} else {
statusString = ", will integrate for ";
List<String> integrations = new ArrayList<>();
if (useMana) {
integrations.add("mana for classes (" + StringUtils.join(usesMana, ",") + ")");
}
if (useAttributes) {
integrations.add("skill/stat attributes");
}
if (registerCurrencies) {
integrations.add("xp currencies");
}
statusString += StringUtils.join(integrations, ",");
}
controller.getLogger().info("AureliumSkills found" + statusString);
if (!useMana) {
controller.getLogger().info(" If you want Magic spells to use AureliumSkills mana, use &7/mconfig configure config aurelium_skills.use_mana true");
}
}
use of com.archyx.aureliumskills.skills.Skills in project MagicPlugin by elBukkit.
the class AureliumSkillsManager method register.
public void register(ConfigurationSection currencyConfiguration) {
if (registerCurrencies) {
List<String> names = new ArrayList<>();
for (Skills skill : Skills.values()) {
ConfigurationSection configuration = currencyConfiguration.getConfigurationSection(skill.name());
if (configuration == null) {
configuration = ConfigurationUtils.newConfigurationSection();
}
controller.register(new AureliumSkillCurrency(this, skill, configuration));
names.add(skill.name());
}
controller.getLogger().info("Registered AureliumSkills XP as currencies: " + StringUtils.join(names, ","));
}
}
Aggregations