InventoryCloseEvent Reason API

Allows you to determine why an inventory was closed, enabling plugin developers
to "confirm" things based on if it was player triggered close or not.
This commit is contained in:
Aikar
2018-07-03 21:52:52 -04:00
parent f8562d67ca
commit 6d3de60244
2 changed files with 60 additions and 0 deletions

View File

@@ -187,6 +187,15 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
*/
public void closeInventory();
// Paper start
/**
* Force-closes the currently open inventory view for this player, if any.
*
* @param reason why the inventory is closing
*/
public void closeInventory(@NotNull org.bukkit.event.inventory.InventoryCloseEvent.Reason reason);
// Paper end
/**
* Returns the ItemStack currently in your hand, can be empty.
*