Class Talisman

java.lang.Object
io.github.pylonmc.rebar.item.RebarItem
io.github.pylonmc.pylon.content.talismans.Talisman
All Implemented Interfaces:
io.github.pylonmc.rebar.item.base.RebarInventoryEffectItem, io.github.pylonmc.rebar.item.base.RebarInventoryTicker, net.kyori.adventure.key.Keyed, org.bukkit.Keyed
Direct Known Subclasses:
AttributeTalisman, BarteringTalisman, BreedingTalisman, EnchantingTalisman, ExperienceTalisman, FarmingTalisman, FlightRing, HuntingTalisman

public abstract class Talisman extends io.github.pylonmc.rebar.item.RebarItem implements io.github.pylonmc.rebar.item.base.RebarInventoryEffectItem
  • Nested Class Summary

    Nested classes/interfaces inherited from class io.github.pylonmc.rebar.item.RebarItem

    io.github.pylonmc.rebar.item.RebarItem.Companion

    Nested classes/interfaces inherited from interface io.github.pylonmc.rebar.item.base.RebarInventoryEffectItem

    io.github.pylonmc.rebar.item.base.RebarInventoryEffectItem.Companion
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final int
     

    Fields inherited from class io.github.pylonmc.rebar.item.RebarItem

    Companion

    Fields inherited from interface io.github.pylonmc.rebar.item.base.RebarInventoryEffectItem

    Companion
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Talisman(@NotNull org.bukkit.inventory.ItemStack stack)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    applyEffect(@NotNull org.bukkit.entity.Player player)
    The implementation of this method MUST call super.applyEffect
    long
     
    int
    Get the level of the talisman, this is used to determine which talismans should overwrite other ones
    abstract org.bukkit.NamespacedKey
    Get the generic key of the talisman, should be the same between all talismans of the same type, ie all health talisman levels have the same return value for this.
    void
    onAddedToInventory(@NotNull org.bukkit.entity.Player player)
     
    void
    onRemovedFromInventory(@NotNull org.bukkit.entity.Player player)
     
    void
    removeEffect(@NotNull org.bukkit.entity.Player player)
    The implementation of this method MUST call super.removeEffect

    Methods inherited from class io.github.pylonmc.rebar.item.RebarItem

    equals, fromStack, fromStack, getAddon, getKey, getPlaceholders, getRebarBlock, getResearch, getResearchBypassPermission, getSchema, getSettings, getSettings, getStack, hashCode, isDisabled, isRebarItem, isRebarItem, place, prePlace, register, register, suppressNameWarnings

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.bukkit.Keyed

    key

    Methods inherited from interface io.github.pylonmc.rebar.item.base.RebarInventoryEffectItem

    getItemKey, onTick
  • Field Details

    • level

      public final int level
  • Constructor Details

    • Talisman

      protected Talisman(@NotNull @NotNull org.bukkit.inventory.ItemStack stack)
  • Method Details

    • onAddedToInventory

      public void onAddedToInventory(@NotNull @NotNull org.bukkit.entity.Player player)
      Specified by:
      onAddedToInventory in interface io.github.pylonmc.rebar.item.base.RebarInventoryEffectItem
    • onRemovedFromInventory

      public void onRemovedFromInventory(@NotNull @NotNull org.bukkit.entity.Player player)
      Specified by:
      onRemovedFromInventory in interface io.github.pylonmc.rebar.item.base.RebarInventoryEffectItem
    • applyEffect

      @MustBeInvokedByOverriders public void applyEffect(@NotNull @NotNull org.bukkit.entity.Player player)
      The implementation of this method MUST call super.applyEffect
      Parameters:
      player - The player who the effect is being applied to
    • removeEffect

      @MustBeInvokedByOverriders public void removeEffect(@NotNull @NotNull org.bukkit.entity.Player player)
      The implementation of this method MUST call super.removeEffect
      Parameters:
      player - The player who the effect is being removed from
    • getBaseTickInterval

      public long getBaseTickInterval()
      Specified by:
      getBaseTickInterval in interface io.github.pylonmc.rebar.item.base.RebarInventoryTicker
    • getLevel

      public int getLevel()
      Get the level of the talisman, this is used to determine which talismans should overwrite other ones
    • getTalismanKey

      public abstract org.bukkit.NamespacedKey getTalismanKey()
      Get the generic key of the talisman, should be the same between all talismans of the same type, ie all health talisman levels have the same return value for this.