what the fuck?
This commit is contained in:
t3hk0d3 2012-08-12 00:53:57 +04:00
parent cfa9de6998
commit e2db122b8a

View File

@ -175,6 +175,23 @@ public class PlayerListener extends ModifyworldListener {
this.checkPlayerInventory(player);
}
@EventHandler(priority = EventPriority.LOW)
public void onPlayerInventoryEvent(InventoryClickEvent event) {
ItemStack item = event.getCursor();
if(item == null || item.getType() == Material.AIR || event.getSlotType() != InventoryType.SlotType.QUICKBAR) {
return;
}
Player player = (Player)event.getWhoClicked();
int targetSlot = player.getInventory().getHeldItemSlot();
if(event.getSlot() == targetSlot && permissionDenied(player, "modifyworld.items.hold", item)) {
event.setCancelled(true);
}
}
@EventHandler(priority = EventPriority.LOW)
public void onPlayerInteractEntity(PlayerInteractEntityEvent event) {
if (this.checkItemUse) {