Skip to content

Commit

Permalink
fix(actions): NMSHand won't be converted as EquipmentSlot
Browse files Browse the repository at this point in the history
  • Loading branch information
PeyaPeyaPeyang committed Mar 12, 2024
1 parent 88cc67e commit fb65903
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.player.PlayerInteractAtEntityEvent;
import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.util.Vector;
import org.jetbrains.annotations.NotNull;
import org.kunlab.scenamatica.enums.ScenarioType;
Expand Down Expand Up @@ -59,12 +58,12 @@ public boolean checkFired(@NotNull ActionContext ctxt, @NotNull Event event)

boolean result = ctxt.ifHasInput(IN_POSITION, position -> position.isAdequate(loc));
if (result)
this.makeOutputs(ctxt, e.getPlayer(), e.getRightClicked(), e.getHand(), loc);
this.makeOutputs(ctxt, e.getPlayer(), e.getRightClicked(), NMSHand.fromEquipmentSlot(e.getHand()), loc);

return result;
}

private void makeOutputs(@NotNull ActionContext ctxt, @NotNull Player player, @NotNull Entity targetEntity, @NotNull EquipmentSlot hand, @NotNull Location position)
private void makeOutputs(@NotNull ActionContext ctxt, @NotNull Player player, @NotNull Entity targetEntity, @NotNull NMSHand hand, @NotNull Location position)
{
ctxt.output(OUT_POSITION, position);
super.makeOutputs(ctxt, player, targetEntity, hand);
Expand Down

0 comments on commit fb65903

Please sign in to comment.