From 69484dcb79998206060376f0b5d484b785e32602 Mon Sep 17 00:00:00 2001 From: Pirgosth Date: Tue, 6 Sep 2022 23:27:50 +0200 Subject: [PATCH] Fixed issue with PlayerInteractEvent and BlockPlaceEvent. --- src/main/java/io/github/pirgosth/xclaim/EventListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/github/pirgosth/xclaim/EventListener.java b/src/main/java/io/github/pirgosth/xclaim/EventListener.java index ed00a72..879cc06 100644 --- a/src/main/java/io/github/pirgosth/xclaim/EventListener.java +++ b/src/main/java/io/github/pirgosth/xclaim/EventListener.java @@ -181,7 +181,7 @@ public void onPlayerUnleashEntity(PlayerUnleashEntityEvent event) { public void onPlayerInteract(PlayerInteractEvent event) { if (isWorldDisabled(event.getPlayer().getWorld())) return; //if(event.getHand() == EquipmentSlot.HAND) return; - if (event.getAction() == Action.RIGHT_CLICK_BLOCK && event.getClickedBlock() != null) { + if (event.getAction() == Action.RIGHT_CLICK_BLOCK && event.getClickedBlock() != null && event.getClickedBlock().getType().isInteractable() && !(event.getPlayer().isSneaking() && event.isBlockInHand())) { if (cancelEvent(event.getPlayer(), event.getClickedBlock().getLocation(), "xclaim.others.interact", "on-others-interact")) { event.setCancelled(true); }