public interface BlockStateMeta extends ItemMeta
限定符和类型 | 方法和说明 |
---|---|
BlockState |
getBlockState()
返回这个物品当前附加的BlockState,如果不存在将创建一个新的.
|
boolean |
hasBlockState()
返回这个物品当前是否附加BlockState.
|
void |
setBlockState(BlockState blockState)
将BlockState副本附加到物品上(设置这个物品的BlockState).
|
addEnchant, addItemFlags, clone, getDisplayName, getEnchantLevel, getEnchants, getItemFlags, getLocalizedName, getLore, hasConflictingEnchant, hasDisplayName, hasEnchant, hasEnchants, hasItemFlag, hasLocalizedName, hasLore, isUnbreakable, removeEnchant, removeItemFlags, setDisplayName, setLocalizedName, setLore, setUnbreakable
serialize
boolean hasBlockState()
原文:Returns whether the item has a block state currently attached to it.
BlockState getBlockState()
这个状态是一个副本,它必须被setBlockState(org.bukkit.block.BlockState)
重新设置(或其它物品).
原文:Returns the currently attached block state 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 setBlockState(org.bukkit.block.BlockState)
void setBlockState(BlockState blockState)
原文:Attaches a copy of the passed block state to the item.
blockState
- 要附加给这个方块的BlockStatejava.lang.IllegalArgumentException
- 如果blockState参数为null或对于这个物品是无效的