mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-01-08 07:27:39 +01:00
Fixed consumables not casting skills
This commit is contained in:
parent
91f136774e
commit
ad9af57ab7
@ -6,6 +6,7 @@ import io.lumine.mythic.lib.api.item.NBTItem;
|
|||||||
import io.lumine.mythic.lib.api.player.EquipmentSlot;
|
import io.lumine.mythic.lib.api.player.EquipmentSlot;
|
||||||
import io.lumine.mythic.lib.comp.target.InteractionType;
|
import io.lumine.mythic.lib.comp.target.InteractionType;
|
||||||
import io.lumine.mythic.lib.damage.MeleeAttackMetadata;
|
import io.lumine.mythic.lib.damage.MeleeAttackMetadata;
|
||||||
|
import io.lumine.mythic.lib.skill.trigger.TriggerType;
|
||||||
import net.Indyuce.mmoitems.MMOItems;
|
import net.Indyuce.mmoitems.MMOItems;
|
||||||
import net.Indyuce.mmoitems.MMOUtils;
|
import net.Indyuce.mmoitems.MMOUtils;
|
||||||
import net.Indyuce.mmoitems.api.ItemAttackMetadata;
|
import net.Indyuce.mmoitems.api.ItemAttackMetadata;
|
||||||
@ -79,7 +80,11 @@ public class ItemUse implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (useItem instanceof Consumable) {
|
if (useItem instanceof Consumable) {
|
||||||
|
|
||||||
|
// Since the interact event is cancelled, no skills is cast by MythicLib. They must be force-cast
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
useItem.getPlayerData().getMMOPlayerData().triggerSkills(player.isSneaking() ? TriggerType.SHIFT_RIGHT_CLICK : TriggerType.RIGHT_CLICK, null);
|
||||||
|
|
||||||
Consumable.ConsumableConsumeResult result = ((Consumable) useItem).useOnPlayer();
|
Consumable.ConsumableConsumeResult result = ((Consumable) useItem).useOnPlayer();
|
||||||
if (result == Consumable.ConsumableConsumeResult.CANCEL)
|
if (result == Consumable.ConsumableConsumeResult.CANCEL)
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user