Commented out class triggers

This commit is contained in:
Indyuce 2022-02-12 11:05:19 +01:00
parent 1d6c7377a2
commit 3ef9011b9a
3 changed files with 21 additions and 27 deletions

View File

@ -140,7 +140,7 @@
<dependency>
<groupId>io.lumine</groupId>
<artifactId>MythicLib-dist</artifactId>
<version>1.3-R27-SNAPSHOT</version>
<version>1.3-R28-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

View File

@ -21,8 +21,6 @@ import net.Indyuce.mmocore.experience.droptable.ExperienceTable;
import net.Indyuce.mmocore.experience.provider.ExperienceDispenser;
import net.Indyuce.mmocore.experience.provider.MainExperienceDispenser;
import net.Indyuce.mmocore.experience.source.type.ExperienceSource;
import net.Indyuce.mmocore.player.playerclass.ClassTrigger;
import net.Indyuce.mmocore.player.playerclass.ClassTriggerType;
import net.Indyuce.mmocore.skill.ClassSkill;
import net.Indyuce.mmocore.skill.RegisteredSkill;
import net.md_5.bungee.api.ChatColor;
@ -53,7 +51,7 @@ public class PlayerClass extends PostLoadObject implements ExperienceObject {
private final Map<StatType, LinearValue> stats = new HashMap<>();
private final Map<String, ClassSkill> skills = new LinkedHashMap<>();
private final List<Subclass> subclasses = new ArrayList<>();
private final Map<String, ClassTrigger> classTriggers = new HashMap<>();
// private final Map<String, ClassTrigger> classTriggers = new HashMap<>();
private final Map<PlayerResource, ResourceRegeneration> resourceHandlers = new HashMap<>();
@Deprecated
@ -295,10 +293,10 @@ public class PlayerClass extends PostLoadObject implements ExperienceObject {
return options.containsKey(option) ? options.get(option) : option.getDefault();
}
@Nullable
public ClassTrigger getClassTrigger(ClassTriggerType type) {
return classTriggers.get(type);
}
// @Nullable
// public ClassTrigger getClassTrigger(ClassTriggerType type) {
// return classTriggers.get(type);
// }
@Deprecated
public Set<String> getEventTriggers() {

View File

@ -1,17 +1,21 @@
package net.Indyuce.mmocore.player.playerclass;
import io.lumine.mythic.lib.MythicLib;
import io.lumine.mythic.lib.UtilityMethods;
import io.lumine.mythic.lib.api.MMOLineConfig;
import io.lumine.mythic.lib.skill.SimpleSkill;
import io.lumine.mythic.lib.skill.Skill;
import io.lumine.mythic.lib.skill.custom.CustomSkill;
import io.lumine.mythic.lib.skill.custom.mechanic.Mechanic;
import io.lumine.mythic.lib.skill.handler.MythicLibSkillHandler;
import io.lumine.mythic.lib.skill.result.SkillResult;
import io.lumine.mythic.lib.skill.trigger.TriggerMetadata;
import net.Indyuce.mmocore.MMOCore;
import net.Indyuce.mmocore.api.player.PlayerData;
import net.Indyuce.mmocore.api.quest.trigger.Trigger;
import io.lumine.mythic.lib.skill.trigger.TriggerType;
import io.lumine.mythic.lib.util.configobject.ConfigObject;
import io.lumine.mythic.lib.util.configobject.LineConfigObject;
import net.Indyuce.mmocore.listener.ClassTriggers;
import org.apache.commons.lang.Validate;
import java.util.ArrayList;
import java.util.List;
/**
@ -28,23 +32,20 @@ import java.util.List;
* @author jules
* @see {@link ClassTriggers}
*/
@Deprecated
public class ClassTrigger {
private final ClassTriggerType type;
private final List<Trigger> triggers = new ArrayList<>();
// private final CustomSkill skill = new CustomSkill("classTrigger", false);
// private final Skill castableSkill = new SimpleSkill(new MythicLibSkillHandler(skill));
private final CustomSkill skill = new CustomSkill("classTrigger", false);
private final Skill castableSkill = new SimpleSkill(TriggerType.CAST, new MythicLibSkillHandler(skill));
public ClassTrigger(String triggerTypeString, List<String> mechanicStringList) {
Validate.notNull(mechanicStringList, "Mechanic list cannot be null");
type = ClassTriggerType.valueOf(UtilityMethods.enumName(triggerTypeString));
for (String key : mechanicStringList) {
MMOLineConfig config = new MMOLineConfig(key);
triggers.add(MMOCore.plugin.loadManager.loadTrigger(config));
// ConfigObject config = new LineConfigObject(new MMOLineConfig(key));
// Mechanic mechanic = MythicLib.plugin.getSkills().loadMechanic(config);
// skill.getMechanics().add(mechanic);
ConfigObject config = new LineConfigObject(new MMOLineConfig(key));
Mechanic mechanic = MythicLib.plugin.getSkills().loadMechanic(config);
skill.getMechanics().add(mechanic);
}
}
@ -54,11 +55,6 @@ public class ClassTrigger {
@Deprecated
public SkillResult trigger(TriggerMetadata triggerMeta) {
// return castableSkill.cast(triggerMeta);
return null;
}
public void trigger(PlayerData player) {
triggers.forEach(trigger -> trigger.apply(player));
return castableSkill.cast(triggerMeta);
}
}