mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-01-03 06:37:47 +01:00
Default item ability no longer prompts console error logs
This commit is contained in:
parent
a85b4d05c3
commit
56f5e580d0
@ -124,9 +124,13 @@ public class AbilityListEdition extends EditionInventory {
|
|||||||
|
|
||||||
for (int j = 1; j < 8; j++)
|
for (int j = 1; j < 8; j++)
|
||||||
if (!getEditedSection().getConfigurationSection("ability").contains("ability" + j)) {
|
if (!getEditedSection().getConfigurationSection("ability").contains("ability" + j)) {
|
||||||
getEditedSection().createSection("ability.ability" + j);
|
|
||||||
registerTemplateEdition();
|
// (Fixes MMOItems#1575) Initialize sample ability to avoid console logs
|
||||||
break;
|
final String tag = "ability" + j;
|
||||||
|
getEditedSection().set("ability." + tag + ".type", "FIREBOLT");
|
||||||
|
getEditedSection().set("ability." + tag + ".mode", "RIGHT_CLICK");
|
||||||
|
registerTemplateEdition();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@ package net.Indyuce.mmoitems.manager;
|
|||||||
|
|
||||||
import io.lumine.mythic.lib.UtilityMethods;
|
import io.lumine.mythic.lib.UtilityMethods;
|
||||||
import io.lumine.mythic.lib.skill.trigger.TriggerType;
|
import io.lumine.mythic.lib.skill.trigger.TriggerType;
|
||||||
import net.Indyuce.mmocore.MMOCore;
|
|
||||||
import net.Indyuce.mmoitems.MMOItems;
|
import net.Indyuce.mmoitems.MMOItems;
|
||||||
import net.Indyuce.mmoitems.api.ConfigFile;
|
import net.Indyuce.mmoitems.api.ConfigFile;
|
||||||
import net.Indyuce.mmoitems.api.ReforgeOptions;
|
import net.Indyuce.mmoitems.api.ReforgeOptions;
|
||||||
@ -243,8 +242,14 @@ public class ConfigManager implements Reloadable {
|
|||||||
return Message.valueOf(UtilityMethods.enumName(path)).getUpdated();
|
return Message.valueOf(UtilityMethods.enumName(path)).getUpdated();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
@NotNull
|
@NotNull
|
||||||
public String getCastingModeName(@NotNull TriggerType triggerType) {
|
public String getCastingModeName(@NotNull TriggerType triggerType) {
|
||||||
|
return getTriggerTypeName(triggerType);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public String getTriggerTypeName(@NotNull TriggerType triggerType) {
|
||||||
return Objects.requireNonNull(triggerTypeNames.get(triggerType), "Trigger type name for '" + triggerType.name() + "' not found");
|
return Objects.requireNonNull(triggerTypeNames.get(triggerType), "Trigger type name for '" + triggerType.name() + "' not found");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ public class Abilities extends ItemStat<RandomAbilityListData, AbilityListData>
|
|||||||
|
|
||||||
data.getAbilities().forEach(ability -> {
|
data.getAbilities().forEach(ability -> {
|
||||||
final StringBuilder builder = new StringBuilder(generalFormat
|
final StringBuilder builder = new StringBuilder(generalFormat
|
||||||
.replace("{trigger}", MMOItems.plugin.getLanguage().getCastingModeName(ability.getTrigger()))
|
.replace("{trigger}", MMOItems.plugin.getLanguage().getTriggerTypeName(ability.getTrigger()))
|
||||||
.replace("{ability}", ability.getAbility().getName()));
|
.replace("{ability}", ability.getAbility().getName()));
|
||||||
|
|
||||||
if (!ability.getModifiers().isEmpty()) builder.append(modifierIfAny);
|
if (!ability.getModifiers().isEmpty()) builder.append(modifierIfAny);
|
||||||
|
@ -21,7 +21,8 @@ public class RandomAbilityData {
|
|||||||
private final Map<String, NumericStatFormula> modifiers = new HashMap<>();
|
private final Map<String, NumericStatFormula> modifiers = new HashMap<>();
|
||||||
|
|
||||||
public RandomAbilityData(ConfigurationSection config) {
|
public RandomAbilityData(ConfigurationSection config) {
|
||||||
Validate.isTrue(config.contains("type") && config.contains("mode"), "Ability is missing type or mode");
|
Validate.isTrue(config.contains("type"), "Missing ability type");
|
||||||
|
Validate.isTrue(config.contains("mode"), "Missing ability trigger type/casting mode");
|
||||||
|
|
||||||
String abilityFormat = config.getString("type").toUpperCase().replace("-", "_").replace(" ", "_");
|
String abilityFormat = config.getString("type").toUpperCase().replace("-", "_").replace(" ", "_");
|
||||||
Validate.isTrue(MMOItems.plugin.getSkills().hasSkill(abilityFormat), "Could not find ability called '" + abilityFormat + "'");
|
Validate.isTrue(MMOItems.plugin.getSkills().hasSkill(abilityFormat), "Could not find ability called '" + abilityFormat + "'");
|
||||||
|
Loading…
Reference in New Issue
Block a user