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> <dependency>
<groupId>io.lumine</groupId> <groupId>io.lumine</groupId>
<artifactId>MythicLib-dist</artifactId> <artifactId>MythicLib-dist</artifactId>
<version>1.3-R27-SNAPSHOT</version> <version>1.3-R28-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </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.ExperienceDispenser;
import net.Indyuce.mmocore.experience.provider.MainExperienceDispenser; import net.Indyuce.mmocore.experience.provider.MainExperienceDispenser;
import net.Indyuce.mmocore.experience.source.type.ExperienceSource; 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.ClassSkill;
import net.Indyuce.mmocore.skill.RegisteredSkill; import net.Indyuce.mmocore.skill.RegisteredSkill;
import net.md_5.bungee.api.ChatColor; 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<StatType, LinearValue> stats = new HashMap<>();
private final Map<String, ClassSkill> skills = new LinkedHashMap<>(); private final Map<String, ClassSkill> skills = new LinkedHashMap<>();
private final List<Subclass> subclasses = new ArrayList<>(); 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<>(); private final Map<PlayerResource, ResourceRegeneration> resourceHandlers = new HashMap<>();
@Deprecated @Deprecated
@ -295,10 +293,10 @@ public class PlayerClass extends PostLoadObject implements ExperienceObject {
return options.containsKey(option) ? options.get(option) : option.getDefault(); return options.containsKey(option) ? options.get(option) : option.getDefault();
} }
@Nullable // @Nullable
public ClassTrigger getClassTrigger(ClassTriggerType type) { // public ClassTrigger getClassTrigger(ClassTriggerType type) {
return classTriggers.get(type); // return classTriggers.get(type);
} // }
@Deprecated @Deprecated
public Set<String> getEventTriggers() { public Set<String> getEventTriggers() {

View File

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