接口 BlockStateMeta

所有超级接口:
Cloneable, ConfigurationSerializable, ItemMeta, PersistentDataHolder

public interface BlockStateMeta extends ItemMeta
  • 方法详细资料

    • hasBlockState

      boolean hasBlockState()
      返回这个物品当前是否附加BlockState.

      原文:Returns whether the item has a block state currently attached to it.

      返回:
      这个物品当前是否附加BlockState
    • getBlockState

      @NotNull @NotNull BlockState getBlockState()
      返回这个物品当前附加的BlockState,如果不存在将创建一个新的.

      这个状态是一个副本,它必须被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)

      返回:
      附加的状态或一个新的状态
    • setBlockState

      void setBlockState(@NotNull @NotNull BlockState blockState)
      将BlockState副本附加到物品上(设置这个物品的BlockState).

      原文:Attaches a copy of the passed block state to the item.

      参数:
      blockState - 要附加给这个方块的BlockState
      抛出:
      IllegalArgumentException - 如果blockState参数为null或对于这个物品是无效的