Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions src/main/java/fr/mrmicky/fastinv/FastInv.java
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,54 @@ public void addClickHandler(Consumer<InventoryClickEvent> clickHandler) {
this.clickHandlers.add(clickHandler);
}

/**
* Remove a handler to handle inventory open.
*
* @param openHandler The handler to remove.
*/
public void removeOpenHandler(Consumer<InventoryOpenEvent> openHandler) {
this.openHandlers.remove(openHandler);
}

/**
* Remove a handler to handle inventory close.
*
* @param closeHandler The handler to remove
*/
public void removeCloseHandler(Consumer<InventoryCloseEvent> closeHandler) {
this.closeHandlers.remove(closeHandler);
}

/**
* Remove a handler to handle inventory click.
*
* @param clickHandler The handler to remove.
*/
public void removeClickHandler(Consumer<InventoryClickEvent> clickHandler) {
this.clickHandlers.remove(clickHandler);
}

/**
* Clear handlers of inventory open.
*/
public void clearOpenHandler() {
this.openHandlers.clear();
}

/**
* Clear handlers of inventory close.
*/
public void clearCloseHandler() {
this.closeHandlers.clear();
}

/**
* Clear handlers of inventory click.
*/
public void clearClickHandler() {
this.clickHandlers.clear();
}

/**
* Open the inventory to a player.
*
Expand Down