Skip to content

Commit

Permalink
Prevent chests from being 'opened' twice
Browse files Browse the repository at this point in the history
  • Loading branch information
Codisimus committed Apr 9, 2016
1 parent cef3d7f commit 76549c3
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.EquipmentSlot;

/**
* Listens for interactions with PhatLootChests
Expand All @@ -26,7 +27,7 @@ public class PhatLootsListener implements Listener {
*/
@EventHandler (ignoreCancelled = true)
public void onPlayerInteract(PlayerInteractEvent event) {
if (!event.hasBlock()) {
if (!event.hasBlock() || event.getHand() != EquipmentSlot.HAND) {
return;
}

Expand Down

0 comments on commit 76549c3

Please sign in to comment.