Skip to content

Commit

Permalink
Merge pull request WesJD#59 from tchristofferson/master
Browse files Browse the repository at this point in the history
No need to throw an error
  • Loading branch information
WesJD authored Dec 31, 2019
2 parents fac7715 + 35c6d7d commit 478e0c1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions api/src/main/java/net/wesjd/anvilgui/AnvilGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,12 @@ private void openInventory() {

/**
* Closes the inventory if it's open.
*
* @throws IllegalArgumentException If the inventory isn't open
*/
public void closeInventory() {
Validate.isTrue(open, "You can't close an inventory that isn't open!");
if (!open) {
return;
}

open = false;

WRAPPER.handleInventoryCloseEvent(player);
Expand Down

0 comments on commit 478e0c1

Please sign in to comment.