接口 BlockDataMeta
-
方法概要
修饰符和类型方法说明getBlockData
(@NotNull Material material) 返回附加给此物品的方块数据, 若不存在则创建一个新的.boolean
返回此物品是否有附加的方块数据.void
setBlockData
(@NotNull BlockData blockData) 附加方块数据副本给此物品.从接口继承的方法 org.bukkit.configuration.serialization.ConfigurationSerializable
serialize
从接口继承的方法 org.bukkit.inventory.meta.ItemMeta
addAttributeModifier, addEnchant, addItemFlags, clone, getAsComponentString, getAsString, getAttributeModifiers, getAttributeModifiers, getAttributeModifiers, getCustomModelData, getCustomTagContainer, getDisplayName, getEnchantLevel, getEnchantmentGlintOverride, getEnchants, getFood, getItemFlags, getItemName, getJukeboxPlayable, getLocalizedName, getLore, getMaxStackSize, getRarity, getTool, hasAttributeModifiers, hasConflictingEnchant, hasCustomModelData, hasDisplayName, hasEnchant, hasEnchantmentGlintOverride, hasEnchants, hasFood, hasItemFlag, hasItemName, hasJukeboxPlayable, hasLocalizedName, hasLore, hasMaxStackSize, hasRarity, hasTool, isFireResistant, isHideTooltip, isUnbreakable, removeAttributeModifier, removeAttributeModifier, removeAttributeModifier, removeEnchant, removeEnchantments, removeItemFlags, setAttributeModifiers, setCustomModelData, setDisplayName, setEnchantmentGlintOverride, setFireResistant, setFood, setHideTooltip, setItemName, setJukeboxPlayable, setLocalizedName, setLore, setMaxStackSize, setRarity, setTool, setUnbreakable, setVersion
从接口继承的方法 org.bukkit.persistence.PersistentDataHolder
getPersistentDataContainer
-
方法详细资料
-
hasBlockData
boolean hasBlockData()返回此物品是否有附加的方块数据.原文: Returns whether the item has block data currently attached to it.
- 返回:
- 是否附加了方块数据
-
getBlockData
返回附加给此物品的方块数据, 若不存在则创建一个新的. 此状态是一个副本, 它必须用setBlockData(org.bukkit.block.data.BlockData)
设置回去 (或设置给其它物品).原文: Returns the currently attached block data for this item or creates a new one if one doesn't exist. The state is a copy, it must be set back (or to another item) with
setBlockData(org.bukkit.block.data.BlockData)
- 参数:
material
- 希望获取到的方块数据与哪种物品相关- 返回:
- 附加的数据或新数据
-
setBlockData
附加方块数据副本给此物品.原文: Attaches a copy of the passed block data to the item.
- 参数:
blockData
- 要附加的方块数据- 抛出:
IllegalArgumentException
- 若 blockData 为 null 或对此物品无效
-