Skip to content

Commit

Permalink
Add event state before handling interactions
Browse files Browse the repository at this point in the history
  • Loading branch information
NahuLD committed Apr 3, 2024
1 parent fa823ea commit 92c961a
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
import org.bukkit.entity.Vehicle;
import org.bukkit.entity.minecart.PoweredMinecart;
import org.bukkit.entity.minecart.StorageMinecart;
import org.bukkit.event.Event;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
Expand Down Expand Up @@ -1623,6 +1624,10 @@ void onPlayerSignOpen(@NotNull PlayerSignOpenEvent event)
void onPlayerInteract(PlayerInteractEvent event)
{
//not interested in left-click-on-air actions
if (event.useInteractedBlock() == Event.Result.DENY || event.useItemInHand() == Event.Result.DENY) {
return;
}

Action action = event.getAction();
if (action == Action.LEFT_CLICK_AIR) return;

Expand Down

0 comments on commit 92c961a

Please sign in to comment.