diff --git a/src/main/java/net/Indyuce/mmoitems/api/player/PlayerData.java b/src/main/java/net/Indyuce/mmoitems/api/player/PlayerData.java index 4c80d11b..087dd3ac 100644 --- a/src/main/java/net/Indyuce/mmoitems/api/player/PlayerData.java +++ b/src/main/java/net/Indyuce/mmoitems/api/player/PlayerData.java @@ -26,6 +26,7 @@ import net.Indyuce.mmoitems.MMOItems; import net.Indyuce.mmoitems.MMOUtils; import net.Indyuce.mmoitems.api.Ability; import net.Indyuce.mmoitems.api.Ability.CastingMode; +import net.Indyuce.mmoitems.api.AttackResult.DamageType; import net.Indyuce.mmoitems.api.ItemSet.SetBonuses; import net.Indyuce.mmoitems.api.AttackResult; import net.Indyuce.mmoitems.api.ConfigFile; @@ -375,11 +376,11 @@ public class PlayerData { * cast */ public void cast(Ability ability) { - cast(getStats().newTemporary(), null, new AttackResult(true), new AbilityData(ability), true); + cast(getStats().newTemporary(), null, new AttackResult(true, DamageType.SKILL), new AbilityData(ability), true); } public void cast(AbilityData data) { - cast(getStats().newTemporary(), null, new AttackResult(true), data, true); + cast(getStats().newTemporary(), null, new AttackResult(true, DamageType.SKILL), data, true); } public void cast(TemporaryStats stats, LivingEntity target, AttackResult result, AbilityData ability, boolean message) { diff --git a/src/main/java/net/Indyuce/mmoitems/comp/RealDualWieldHook.java b/src/main/java/net/Indyuce/mmoitems/comp/RealDualWieldHook.java index d6568750..4fc4cf3f 100644 --- a/src/main/java/net/Indyuce/mmoitems/comp/RealDualWieldHook.java +++ b/src/main/java/net/Indyuce/mmoitems/comp/RealDualWieldHook.java @@ -12,6 +12,7 @@ import com.evill4mer.RealDualWield.Api.PlayerDamageEntityWithOffhandEvent; import net.Indyuce.mmoitems.MMOItems; import net.Indyuce.mmoitems.api.AttackResult; import net.Indyuce.mmoitems.api.TypeSet; +import net.Indyuce.mmoitems.api.AttackResult.DamageType; import net.Indyuce.mmoitems.api.interaction.weapon.Weapon; import net.Indyuce.mmoitems.api.item.NBTItem; import net.Indyuce.mmoitems.api.player.PlayerData; @@ -40,7 +41,7 @@ public class RealDualWieldHook implements Listener { */ PlayerData playerData = PlayerData.get(player); NBTItem item = MMOItems.plugin.getNMS().getNBTItem(event.getItemInOffhand()); - AttackResult result = new AttackResult(true, event.getDamage()); + AttackResult result = new AttackResult(event.getDamage(), DamageType.WEAPON, DamageType.PHYSICAL); if (item.hasType()) { Weapon weapon = new Weapon(playerData, item, item.getType()); diff --git a/src/main/java/net/Indyuce/mmoitems/listener/ItemUse.java b/src/main/java/net/Indyuce/mmoitems/listener/ItemUse.java index a3134165..bf3e93d5 100644 --- a/src/main/java/net/Indyuce/mmoitems/listener/ItemUse.java +++ b/src/main/java/net/Indyuce/mmoitems/listener/ItemUse.java @@ -29,6 +29,7 @@ import net.Indyuce.mmoitems.api.AttackResult; import net.Indyuce.mmoitems.api.Message; import net.Indyuce.mmoitems.api.Type; import net.Indyuce.mmoitems.api.TypeSet; +import net.Indyuce.mmoitems.api.AttackResult.DamageType; import net.Indyuce.mmoitems.api.interaction.Consumable; import net.Indyuce.mmoitems.api.interaction.GemStone; import net.Indyuce.mmoitems.api.interaction.GemStone.ApplyResult; @@ -117,7 +118,7 @@ public class ItemUse implements Listener { */ PlayerData playerData = PlayerData.get(player); NBTItem item = MMOItems.plugin.getNMS().getNBTItem(player.getInventory().getItemInMainHand()); - AttackResult result = new AttackResult(true, event.getDamage()); + AttackResult result = new AttackResult(event.getDamage(), DamageType.WEAPON, DamageType.PHYSICAL); if (item.hasType()) { Weapon weapon = new Weapon(playerData, item, item.getType()); diff --git a/src/main/java/net/Indyuce/mmoitems/listener/PlayerListener.java b/src/main/java/net/Indyuce/mmoitems/listener/PlayerListener.java index f3fbba1b..e0f26cd0 100644 --- a/src/main/java/net/Indyuce/mmoitems/listener/PlayerListener.java +++ b/src/main/java/net/Indyuce/mmoitems/listener/PlayerListener.java @@ -23,6 +23,7 @@ import org.bukkit.inventory.ItemStack; import net.Indyuce.mmoitems.MMOItems; import net.Indyuce.mmoitems.ability.Magical_Shield; import net.Indyuce.mmoitems.api.Ability.CastingMode; +import net.Indyuce.mmoitems.api.AttackResult.DamageType; import net.Indyuce.mmoitems.api.AttackResult; import net.Indyuce.mmoitems.api.SoulboundInfo; import net.Indyuce.mmoitems.api.player.PlayerData; @@ -87,7 +88,7 @@ public class PlayerListener implements Listener { LivingEntity damager = (LivingEntity) event.getDamager(); Player player = (Player) event.getEntity(); - PlayerData.get(player).castAbilities(damager, new AttackResult(true, event.getDamage()), CastingMode.WHEN_HIT); + PlayerData.get(player).castAbilities(damager, new AttackResult(event.getDamage(), DamageType.SKILL), CastingMode.WHEN_HIT); } @EventHandler(priority = EventPriority.LOW) @@ -97,7 +98,7 @@ public class PlayerListener implements Listener { Player player = event.getPlayer(); boolean left = event.getAction() == Action.LEFT_CLICK_AIR || event.getAction() == Action.LEFT_CLICK_BLOCK; - PlayerData.get(player).castAbilities(null, new AttackResult(true), player.isSneaking() ? (left ? CastingMode.SHIFT_LEFT_CLICK : CastingMode.SHIFT_RIGHT_CLICK) : (left ? CastingMode.LEFT_CLICK : CastingMode.RIGHT_CLICK)); + PlayerData.get(player).castAbilities(null, new AttackResult(true, DamageType.SKILL), player.isSneaking() ? (left ? CastingMode.SHIFT_LEFT_CLICK : CastingMode.SHIFT_RIGHT_CLICK) : (left ? CastingMode.LEFT_CLICK : CastingMode.RIGHT_CLICK)); } /*