From 3c046682ccaf66bf8d5dd8c83d9ccde4950e1a5b Mon Sep 17 00:00:00 2001 From: Indyuce Date: Tue, 24 Dec 2019 00:53:33 +0100 Subject: [PATCH] !Fixed an issue with ray traces --- .../net/Indyuce/mmocore/api/skill/TargetSkillResult.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/Indyuce/mmocore/api/skill/TargetSkillResult.java b/src/main/java/net/Indyuce/mmocore/api/skill/TargetSkillResult.java index 840b234d..d7159efd 100644 --- a/src/main/java/net/Indyuce/mmocore/api/skill/TargetSkillResult.java +++ b/src/main/java/net/Indyuce/mmocore/api/skill/TargetSkillResult.java @@ -1,12 +1,11 @@ package net.Indyuce.mmocore.api.skill; import org.bukkit.entity.LivingEntity; +import org.bukkit.util.RayTraceResult; import net.Indyuce.mmocore.MMOCoreUtils; import net.Indyuce.mmocore.api.player.PlayerData; import net.Indyuce.mmocore.api.skill.Skill.SkillInfo; -import net.mmogroup.mmolib.MMOLib; -import net.mmogroup.mmolib.api.MMORayTraceResult; public class TargetSkillResult extends SkillResult { private LivingEntity target; @@ -15,11 +14,11 @@ public class TargetSkillResult extends SkillResult { super(data, skill); if (isSuccessful()) { - MMORayTraceResult result = MMOLib.plugin.getVersion().getWrapper().rayTrace(data.getPlayer(), data.getPlayer().getEyeLocation().getDirection(), range, entity -> MMOCoreUtils.canTarget(data.getPlayer(), entity)); + RayTraceResult result = data.getPlayer().getWorld().rayTraceEntities(data.getPlayer().getEyeLocation(), data.getPlayer().getEyeLocation().getDirection(), range, entity -> MMOCoreUtils.canTarget(data.getPlayer(), entity)); if (result == null) abort(CancelReason.OTHER); else - target = (LivingEntity) result.getHit(); + target = (LivingEntity) result.getHitEntity(); } }