Class ModalItem
java.lang.Object
io.rhythmknights.coreapi.component.modal.ModalItem
ModalItem represents the
ItemStack on the Inventory-
Constructor Summary
ConstructorsConstructorDescriptionModalItem(@NotNull org.bukkit.Material material) ModalItem(@NotNull org.bukkit.Material material, @Nullable ModalAction<@NotNull org.bukkit.event.inventory.InventoryClickEvent> action) Alternate constructor that takesMaterialinstead of anItemStackModalItem(@NotNull org.bukkit.inventory.ItemStack itemStack) Secondary constructor with no actionModalItem(@NotNull org.bukkit.inventory.ItemStack itemStack, @Nullable ModalAction<@NotNull org.bukkit.event.inventory.InventoryClickEvent> action) Main constructor of the ModalItem -
Method Summary
Modifier and TypeMethodDescription@Nullable ModalAction<org.bukkit.event.inventory.InventoryClickEvent> Gets theModalActionto do when the player clicks on it@NotNull org.bukkit.inventory.ItemStackGets the ModalItem'sItemStackvoidsetAction(@Nullable ModalAction<@NotNull org.bukkit.event.inventory.InventoryClickEvent> action) Replaces theModalActionof the current Modal ItemvoidsetItemStack(@NotNull org.bukkit.inventory.ItemStack itemStack) Replaces theItemStackof the Modal Item
-
Constructor Details
-
ModalItem
public ModalItem(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack, @Nullable @Nullable ModalAction<@NotNull org.bukkit.event.inventory.InventoryClickEvent> action) Main constructor of the ModalItem- Parameters:
itemStack- TheItemStackto be usedaction- TheModalActionto run when clicking on the Item
-
ModalItem
public ModalItem(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) Secondary constructor with no action- Parameters:
itemStack- The ItemStack to be used
-
ModalItem
public ModalItem(@NotNull @NotNull org.bukkit.Material material) - Parameters:
material- TheMaterialto be used when invoking class
-
ModalItem
public ModalItem(@NotNull @NotNull org.bukkit.Material material, @Nullable @Nullable ModalAction<@NotNull org.bukkit.event.inventory.InventoryClickEvent> action) Alternate constructor that takesMaterialinstead of anItemStack- Parameters:
material- TheMaterialto be used when invoking classaction- TheModalActionshould be passed onInventoryClickEvent
-
-
Method Details
-
getItemStack
@NotNull public @NotNull org.bukkit.inventory.ItemStack getItemStack()Gets the ModalItem'sItemStack- Returns:
- The
ItemStack
-
setItemStack
public void setItemStack(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) Replaces theItemStackof the Modal Item- Parameters:
itemStack- The newItemStack
-
getAction
Gets theModalActionto do when the player clicks on it -
setAction
public void setAction(@Nullable @Nullable ModalAction<@NotNull org.bukkit.event.inventory.InventoryClickEvent> action) Replaces theModalActionof the current Modal Item- Parameters:
action- The newModalActionto set
-