support for ML 1.2

This commit is contained in:
Indyuce 2021-12-27 14:00:54 +01:00
parent 492e406f2d
commit adaafe72b6

View File

@ -81,11 +81,7 @@ 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.setUseItemInHand(Event.Result.DENY); event.setUseItemInHand(Event.Result.DENY);
useItem.getPlayerData().getMMOPlayerData().triggerSkills(player.isSneaking() ? TriggerType.SHIFT_RIGHT_CLICK : TriggerType.RIGHT_CLICK, null);
Consumable.ConsumableConsumeResult result = ((Consumable) useItem).useOnPlayer(event.getHand()); Consumable.ConsumableConsumeResult result = ((Consumable) useItem).useOnPlayer(event.getHand());
if (result == Consumable.ConsumableConsumeResult.CANCEL) if (result == Consumable.ConsumableConsumeResult.CANCEL)
return; return;