mirror of
https://github.com/Crazy-Crew/CrazyAuctions.git
synced 2024-11-10 10:10:22 +01:00
add other useful methods
This commit is contained in:
parent
5bdd4aae36
commit
3383086e38
@ -1,7 +1,13 @@
|
|||||||
package com.badbones69.crazyauctions.configs.beans;
|
package com.badbones69.crazyauctions.configs.beans;
|
||||||
|
|
||||||
import ch.jalu.configme.Comment;
|
import ch.jalu.configme.Comment;
|
||||||
|
import com.ryderbelserion.vital.paper.api.builders.gui.interfaces.GuiItem;
|
||||||
|
import com.ryderbelserion.vital.paper.api.builders.gui.types.PaginatedGui;
|
||||||
|
import com.ryderbelserion.vital.paper.api.builders.items.ItemBuilder;
|
||||||
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class ButtonProperty {
|
public class ButtonProperty {
|
||||||
|
|
||||||
@ -94,4 +100,16 @@ public class ButtonProperty {
|
|||||||
public int getSlot() {
|
public int getSlot() {
|
||||||
return this.slot;
|
return this.slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final ItemStack getItemStack() {
|
||||||
|
return new ItemBuilder<>().withType(getMaterial()).setDisplayName(getDisplayName()).setDisplayLore(getDisplayLore()).getStack();
|
||||||
|
}
|
||||||
|
|
||||||
|
public final GuiItem getGuiItem(final Consumer<InventoryClickEvent> consumer) {
|
||||||
|
return new GuiItem(getItemStack(), consumer::accept);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setItem(final Consumer<InventoryClickEvent> consumer, final PaginatedGui gui) {
|
||||||
|
gui.setItem(getSlot(), getGuiItem(consumer));
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user