mirror of
https://github.com/PEXPlugins/Modifyworld.git
synced 2024-11-21 11:26:13 +01:00
Wait....
what the fuck?
This commit is contained in:
parent
cfa9de6998
commit
e2db122b8a
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user