Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler(priority = EventPriority.MONITOR)
- public void onInventoryClick(InventoryClickEvent e) {
- if (e.getWhoClicked() instanceof Player) {
- Player p = (Player) e.getWhoClicked();
- int[] _cancel = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 17, 18, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35 };
- int[] cancel = { 45, 46, 47, 51, 52, 53 };
- int x;
- int size1 = 54;
- int size2 = 36;
- Inventory inv = p.getOpenInventory().getTopInventory();
- String invName = plugin.getInvName("Name");
- String binvName = plugin.getInvName1("Name");
- if ((inv.getTitle().contains(binvName)) && (inv.getSize() == size1)) {
- for (x = 0; x < cancel.length; x++) {
- if (cancel[x] == e.getSlot()) {
- e.setCancelled(true);
- break;
- }
- }
- }
- if ((inv.getTitle().contains(invName)) && (inv.getSize() == size2)) {
- for (x = 0; x < _cancel.length; x++) {
- if (_cancel[x] == e.getSlot()) {
- e.setCancelled(true);
- break;
- } else if (e.getSlot() == 10) {
- p.closeInventory();
- blocksInv(p);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement