should fix item usage issue

This commit is contained in:
Gabriele C 2015-09-13 15:18:22 +02:00
parent 76b4f62e79
commit 3cbc7ab18f

View File

@ -651,7 +651,7 @@ public class AuthMePlayerListener implements Listener {
event.setCancelled(true); event.setCancelled(true);
} }
@EventHandler(ignoreCancelled = true, priority = EventPriority.LOWEST) @EventHandler(ignoreCancelled = true, priority = EventPriority.NORMAL)
public void onPlayerInteract(PlayerInteractEvent event) { public void onPlayerInteract(PlayerInteractEvent event) {
if (event.getPlayer() == null) if (event.getPlayer() == null)
return; return;
@ -675,8 +675,9 @@ public class AuthMePlayerListener implements Listener {
return; return;
} }
} }
if (event.getClickedBlock() != null && event.getClickedBlock().getType() != Material.AIR) if (event.getClickedBlock() != null){
event.setUseInteractedBlock(org.bukkit.event.Event.Result.DENY); event.setUseInteractedBlock(org.bukkit.event.Event.Result.DENY);
}
event.setUseItemInHand(org.bukkit.event.Event.Result.DENY); event.setUseItemInHand(org.bukkit.event.Event.Result.DENY);
event.setCancelled(true); event.setCancelled(true);
} }