Class BlockTagManager

java.lang.Object
org.strassburger.lifestealz.util.customblocks.BlockTagManager

public final class BlockTagManager extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static <P, C> C
    getBlockTag(org.bukkit.block.Block block, org.bukkit.NamespacedKey key, org.bukkit.persistence.PersistentDataType<P,C> type)
    Gets a persistent data value from a block
    static <P, C> void
    tagBlock(org.bukkit.block.Block block, org.bukkit.NamespacedKey key, org.bukkit.persistence.PersistentDataType<P,C> type, C value)
    Tags a block with a persistent data value

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • tagBlock

      public static <P, C> void tagBlock(org.bukkit.block.Block block, org.bukkit.NamespacedKey key, org.bukkit.persistence.PersistentDataType<P,C> type, C value)
      Tags a block with a persistent data value. [!!!] This method only works for blocks that have a TileState (like chests, furnaces, etc.).
      Type Parameters:
      P - the type of the persistent data value
      C - the type of the value to set
      Parameters:
      block - the block to tag
      key - the NamespacedKey to use for the tag
      type - the PersistentDataType to use for the tag
      value - the value to set for the tag
    • getBlockTag

      public static <P, C> C getBlockTag(org.bukkit.block.Block block, org.bukkit.NamespacedKey key, org.bukkit.persistence.PersistentDataType<P,C> type)
      Gets a persistent data value from a block. [!!!] This method only works for blocks that have a TileState (like chests, furnaces, etc.).
      Type Parameters:
      P - the type of the persistent data value
      C - the type of the value to get
      Parameters:
      block - the block to get the tag from
      key - the NamespacedKey to use for the tag
      type - the PersistentDataType to use for the tag
      Returns:
      the value of the tag, or null if not found