fix(session): prioritize native door interaction
Release / release (push) Successful in 9m57s

This commit is contained in:
dmg committed 2026-09-21 11:57:22 -04:00
1 parent 8b5461753c
commit be8870502f
2 files changed
+41

No files matched your search

@@ -353,6 +353,7 @@ public final class EquipmentSessionEvents implements Listener, AutoCloseable {
if (allowed && event.getHand() == EquipmentSlot.HAND && (event.getAction() == org.bukkit.event.block.Action.RIGHT_CLICK_AIR
|| event.getAction() == org.bukkit.event.block.Action.RIGHT_CLICK_BLOCK)) {
var selected = sessions.selectedControl(event.getPlayer(), event.getItem()).orElse(null);
if (selected != null && !selected.ability().isEmpty() && doorInteraction(event)) return;
if (selected != null && useGesture(selected)) {
org.bukkit.entity.Entity target = selected.ability().equals("hex")
|| selected.ability().equals("mending_light")
@@ -367,6 +368,12 @@ public final class EquipmentSessionEvents implements Listener, AutoCloseable {
}
}
private boolean doorInteraction(org.bukkit.event.player.PlayerInteractEvent event) {
var block = event.getClickedBlock();
return event.getAction() == org.bukkit.event.block.Action.RIGHT_CLICK_BLOCK && block != null
&& block.getBlockData() instanceof org.bukkit.block.data.type.Door;
}
private void beginDraw(Player player, ItemStack item, EquipmentSessions.SelectedControl selected) {
UUID owner = player.getUniqueId();
if (closed || draws.containsKey(owner) || player.hasActiveItem()) return;