Class AbstractComponent

java.lang.Object
org.bukkit.inventory.ItemStack
fr.multimc.api.spigot.common.gui.components.AbstractComponent
All Implemented Interfaces:
Cloneable, net.kyori.adventure.text.event.HoverEventSource<net.kyori.adventure.text.event.HoverEvent.ShowItem>, net.kyori.adventure.translation.Translatable, org.bukkit.configuration.serialization.ConfigurationSerializable, org.bukkit.Translatable
Direct Known Subclasses:
ExitComponent, LinkedComponent

public abstract class AbstractComponent extends org.bukkit.inventory.ItemStack
Abstract class for representing a GUI component.
  • Constructor Summary

    Constructors
    Constructor
    Description
    AbstractComponent(@NotNull org.bukkit.inventory.ItemStack itemStack)
    Creates a new AbstractComponent instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract void
    onClicked(@NotNull AbstractGui gui, @NotNull MmcPlayer mmcPlayer)
    Called when the AbstractComponent is clicked in the GUI.

    Methods inherited from class org.bukkit.inventory.ItemStack

    add, add, addEnchantment, addEnchantments, addItemFlags, addUnsafeEnchantment, addUnsafeEnchantments, asHoverEvent, asOne, asQuantity, canRepair, clone, containsEnchantment, damage, deserialize, deserializeBytes, displayName, editMeta, editMeta, enchantWithLevels, ensureServerConversions, equals, getAmount, getData, getDurability, getEnchantmentLevel, getEnchantments, getI18NDisplayName, getItemFlags, getItemMeta, getLore, getMaxItemUseDuration, getMaxStackSize, getRarity, getTranslationKey, getType, hashCode, hasItemFlag, hasItemMeta, isRepairableBy, isSimilar, lore, lore, removeEnchantment, removeItemFlags, serialize, serializeAsBytes, setAmount, setData, setDurability, setItemMeta, setLore, setType, subtract, subtract, toString, translationKey

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface net.kyori.adventure.text.event.HoverEventSource

    asHoverEvent
  • Constructor Details

    • AbstractComponent

      public AbstractComponent(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack)
      Creates a new AbstractComponent instance.
      Parameters:
      itemStack - The ItemStack representing this component.
  • Method Details

    • onClicked

      public abstract void onClicked(@NotNull @NotNull AbstractGui gui, @NotNull @NotNull MmcPlayer mmcPlayer)
      Called when the AbstractComponent is clicked in the GUI.
      Parameters:
      gui - The GUI that this component is part of.
      mmcPlayer - The MmcPlayer that clicked this component.