Prevent empty buttons from refreshing the inventory. (#88)

This commit is contained in:
Andrew 2018-11-21 00:03:39 +00:00 committed by Austin Mayes
parent ddfd2f9fc0
commit 67f3e144eb
1 changed files with 2 additions and 1 deletions

View File

@ -12,6 +12,7 @@ import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryOpenEvent;
import tc.oc.commons.bukkit.gui.buttons.Button;
import tc.oc.commons.bukkit.gui.buttons.empty.EmptyButton;
import tc.oc.commons.core.plugin.PluginFacet;
import tc.oc.pgm.events.ObserverInteractEvent;
@ -48,7 +49,7 @@ public class InterfaceListener implements Listener, PluginFacet {
if (gui != null) {
event.setCancelled(true);
for (Button button : InterfaceManager.getButtons(gui, event.getRawSlot())) {
if (button != null) {
if (button != null && !(button instanceof EmptyButton)) {
button.function(player);
player.updateInventory();
}