net.badbird5907.blib.menu.buttons.Button Maven / Gradle / Ivy
package net.badbird5907.blib.menu.buttons;
import net.badbird5907.blib.util.ItemBuilder;
import net.badbird5907.blib.util.XMaterial;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
import org.bukkit.inventory.ItemStack;
import java.util.Arrays;
import java.util.List;
public abstract class Button {
public abstract ItemStack getItem(Player player);
public abstract int getSlot();
public void onClick(Player player, int slot, ClickType clickType) {
}
public int[] getSlots() {
return null;
}
public boolean hasSlot(int slot) {
return slot == this.getSlot() || this.getSlots() != null && Arrays.stream(this.getSlots()).anyMatch(i -> i == slot);
}
public static boolean hasSlot(List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy