Skip to content

Commit

Permalink
Fixed issue with PlayerInteractEvent and BlockPlaceEvent.
Browse files Browse the repository at this point in the history
  • Loading branch information
Pirgosth committed Sep 6, 2022
1 parent 56e0d71 commit 69484dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/io/github/pirgosth/xclaim/EventListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 69484dc

Please sign in to comment.