Class BlockTagManager
java.lang.Object
com.zetaplugins.lifestealz.util.customblocks.BlockTagManager
-
Method Summary
Modifier and TypeMethodDescriptionstatic <P,C> C getBlockTag(Block block, NamespacedKey key, PersistentDataType<P, C> type) Gets a persistent data value from a blockstatic <P,C> void tagBlock(Block block, NamespacedKey key, PersistentDataType<P, C> type, C value) Tags a block with a persistent data value
-
Method Details
-
tagBlock
public static <P,C> void tagBlock(Block block, NamespacedKey key, 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 valueC- the type of the value to set- Parameters:
block- the block to tagkey- the NamespacedKey to use for the tagtype- the PersistentDataType to use for the tagvalue- the value to set for the tag
-
getBlockTag
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 valueC- the type of the value to get- Parameters:
block- the block to get the tag fromkey- the NamespacedKey to use for the tagtype- the PersistentDataType to use for the tag- Returns:
- the value of the tag, or null if not found
-