Commit d9f399f7 authored by ASangarin's avatar ASangarin
Browse files

support for latest mythicmobs api

parent f7c27891
......@@ -6,7 +6,7 @@
<groupId>eu.asangarin</groupId>
<artifactId>mythickeysplugin</artifactId>
<version>1.4</version>
<version>1.4.1</version>
<packaging>jar</packaging>
<name>MythicKeysPlugin</name>
......@@ -59,7 +59,7 @@
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>22.0.0</version>
<version>23.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
......@@ -76,9 +76,10 @@
</dependency>
<dependency>
<groupId>io.lumine</groupId>
<artifactId>MythicMobs-Dist</artifactId>
<version>5.0.0-SNAPSHOT</version>
<artifactId>Mythic-Dist</artifactId>
<version>5.0.1</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
</dependencies>
</project>
package eu.asangarin.mythickeys.compat;
import io.lumine.xikage.mythicmobs.MythicMobs;
import io.lumine.xikage.mythicmobs.adapters.AbstractPlayer;
import io.lumine.xikage.mythicmobs.adapters.bukkit.BukkitAdapter;
import io.lumine.xikage.mythicmobs.mobs.GenericCaster;
import io.lumine.xikage.mythicmobs.skills.SkillMetadata;
import io.lumine.xikage.mythicmobs.skills.SkillTrigger;
import io.lumine.mythic.api.adapters.AbstractPlayer;
import io.lumine.mythic.api.mobs.GenericCaster;
import io.lumine.mythic.api.skills.SkillMetadata;
import io.lumine.mythic.bukkit.BukkitAdapter;
import io.lumine.mythic.bukkit.MythicBukkit;
import io.lumine.mythic.core.skills.SkillMetadataImpl;
import io.lumine.mythic.core.skills.SkillTriggers;
import org.bukkit.entity.Player;
import java.util.HashSet;
......@@ -14,12 +15,12 @@ public class MythicMobsCompat {
public static void runSkill(String id, Player player) {
if (id == null || id.isEmpty()) return;
MythicMobs.inst().getSkillManager().getSkill(id).ifPresent(skill -> {
MythicBukkit.inst().getSkillManager().getSkill(id).ifPresent(skill -> {
AbstractPlayer trigger = BukkitAdapter.adapt(player);
GenericCaster genericCaster = new GenericCaster(trigger);
SkillMetadata skillMeta = new SkillMetadata(SkillTrigger.API, genericCaster, trigger, BukkitAdapter.adapt(player.getLocation()),
SkillMetadata skillMeta = new SkillMetadataImpl(SkillTriggers.API, genericCaster, trigger, BukkitAdapter.adapt(player.getLocation()),
new HashSet<>(), null, 1.0F);
if (skill.usable(skillMeta, SkillTrigger.API)) skill.execute(skillMeta);
if (skill.isUsable(skillMeta, SkillTriggers.API)) skill.execute(skillMeta);
});
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment