trentech / StackBan

MIT License
4 stars 12 forks source link

Using ClickInventoryEvent instead of AffectSlotEvent to prevent crafting #19

Open Vontus opened 7 years ago

Vontus commented 7 years ago

By using ClickInventoryEvent you can check the type of inventory that was clicked using event.getTargetInventory(). This way you won't be cancelling events that occur in inventories like chests to prevent items from being crafted.

ClickInventoryEvent extends AffectSlotEvent, so you aren't missing any previous functionality.