Use of recent trigger types conventions

This commit is contained in:
Jules 2022-02-08 21:10:38 +01:00
parent b1c2e660a0
commit 3ba7839833
4 changed files with 5 additions and 5 deletions

View File

@ -70,7 +70,7 @@ public abstract class Ability<T extends AbilityMetadata> extends SkillHandler<T>
RegisteredSkill registeredSkill = new RegisteredSkill(this);
// Corresponding ability data
AbilityData abilityData = new AbilityData(registeredSkill, TriggerType.API);
AbilityData abilityData = new AbilityData(registeredSkill, TriggerType.CAST);
for (String mod : modifiers.keySet())
abilityData.setModifier(mod, meta.getModifier(mod));

View File

@ -117,7 +117,7 @@ public class MMOItemsAPI {
public AttackMetadata castAbility(Player player, String skillName, Map<String, Double> modifiers, @Nullable LivingEntity target, @Nullable AttackMetadata attackMeta) {
// Setup ability
AbilityData abilityData = new AbilityData(getSkillById(skillName), TriggerType.API);
AbilityData abilityData = new AbilityData(getSkillById(skillName), TriggerType.CAST);
modifiers.forEach((key, value) -> abilityData.setModifier(key, value));
// Cast ability
@ -158,7 +158,7 @@ public class MMOItemsAPI {
* based on entity attacks; in that case no attack metadata is provided.
*/
public void castSkill(Player player, RegisteredSkill skill, @NotNull Map<String, Double> modifiers, @Nullable LivingEntity target, @Nullable AttackMetadata attackMeta) {
AbilityData castable = new AbilityData(skill, TriggerType.API);
AbilityData castable = new AbilityData(skill, TriggerType.CAST);
modifiers.forEach((mod, value) -> castable.setModifier(mod, value));
PlayerMetadata caster = MMOPlayerData.get(player).getStatMap().cache(EquipmentSlot.MAIN_HAND);

View File

@ -60,7 +60,7 @@ public class AbilityCommandTreeNode extends CommandTreeNode {
}
// modifiers
AbilityData ability = new AbilityData(MMOItems.plugin.getSkills().getSkill(key), TriggerType.API);
AbilityData ability = new AbilityData(MMOItems.plugin.getSkills().getSkill(key), TriggerType.CAST);
for (int j = 3; j < args.length - 1; j += 2) {
String name = args[j];
String value = args[j + 1];

View File

@ -332,7 +332,7 @@ public class PlayerListener implements Listener {
}
// Create ability data
AbilityData abilityData = new AbilityData(registeredSkill, TriggerType.API);
AbilityData abilityData = new AbilityData(registeredSkill, TriggerType.CAST);
for (String mod : event.getCast().getHandler().getModifiers())
abilityData.setModifier(mod, event.getMetadata().getModifier(mod));