程序包 org.bukkit.block

接口 Skull

所有超级接口:
BlockState, Metadatable, PersistentDataHolder, TileState

public interface Skull extends TileState
代表头颅.
  • 方法详细资料

    • hasOwner

      boolean hasOwner()
      检测此头颅是否有主人.

      原文: Checks to see if the skull has an owner

      返回:
      true表示此头颅有主人
    • getOwner

      已过时。
      如果存在,获取这个头颅的主人.

      原文: Gets the owner of the skull, if one exists

      返回:
      头颅主人的名字,如果此头颅没有主人将返回null
    • setOwner

      @Deprecated @Contract("null -> false") boolean setOwner(@Nullable @Nullable String name)
      设置头颅的主人.

      根据提供的名称获取配置文件数据时涉及一个可能的阻塞式Web请求.

      原文: Sets the owner of the skull

      Involves a potentially blocking web request to acquire the profile data for the provided name.

      参数:
      name - 新的头颅主人的名字
      返回:
      true表示成功设置这个头颅的主人
    • getOwningPlayer

      @Nullable @Nullable OfflinePlayer getOwningPlayer()
      获取拥有此头颅的玩家. 该头颅可能显示出玩家皮肤的头部, 这取决于头颅的类型.

      原文:Get the player which owns the skull. This player may appear as the texture depending on skull type.

      返回:
      头颅所有者
    • setOwningPlayer

      void setOwningPlayer(@NotNull @NotNull OfflinePlayer player)
      设置拥有此头颅的玩家. 该头颅可能显示出玩家皮肤的头部, 这取决于头颅的类型.

      原文:Set the player which owns the skull. This player may appear as the texture depending on skull type.

      参数:
      player - 头颅所有者
    • getOwnerProfile

      @Nullable @Nullable PlayerProfile getOwnerProfile()
      获取拥有此头颅的玩家的资料. 此玩家资料所含的纹理取决于头颅类型.

      原文:Gets the profile of the player who owns the skull. This player profile may appear as the texture depending on skull type.

      返回:
      头颅所有者的资料
    • setOwnerProfile

      void setOwnerProfile(@Nullable @Nullable PlayerProfile profile)
      设置拥有此头颅的玩家的资料. 此玩家资料所含的纹理取决于头颅类型.

      此资料必须包含唯一 id 和皮肤纹理. 如果两者都缺, 则资料必须包含玩家名, 服务器将利用玩家名来尝试查找其唯一 id 和皮肤纹理.

      原文:Sets the profile of the player who owns the skull. This player profile may appear as the texture depending on skull type.

      The profile must contain both a unique id and a skin texture. If either of these is missing, the profile must contain a name by which the server will then attempt to look up the unique id and skin texture.

      参数:
      profile - 头颅所有者的资料
      抛出:
      IllegalArgumentException - 如果资料没有包含必要信息
    • getNoteBlockSound

      @Nullable @Nullable NamespacedKey getNoteBlockSound()
      Gets the sound to play if the skull is placed on a note block.
      Note: This only works for player heads. For other heads, see Instrument.
      返回:
      the key of the sound, or null
    • setNoteBlockSound

      void setNoteBlockSound(@Nullable @Nullable NamespacedKey noteBlockSound)
      Sets the sound to play if the skull is placed on a note block.
      Note: This only works for player heads. For other heads, see Instrument.
      参数:
      noteBlockSound - the key of the sound to be played, or null
    • getRotation

      已过时。
      请使用 BlockData
      获取这个头颅在世界的角度 (或头颅的朝向如果这个头颅被挂在墙上).

      原文: Gets the rotation of the skull in the world (or facing direction if this is a wall mounted skull).

      返回:
      头颅的角度
    • setRotation

      @Deprecated void setRotation(@NotNull @NotNull BlockFace rotation)
      已过时。
      请使用 BlockData
      设置这个头颅在世界的角度 (或头颅的朝向如果这个头颅被挂在墙上).

      原文: Sets the rotation of the skull in the world (or facing direction if this is a wall mounted skull).

      参数:
      rotation - 头颅的角度
    • getSkullType

      已过时。
      请检查 Material 类型
      获取头颅的类型.

      原文: Gets the type of skull

      返回:
      头颅的类型
    • setSkullType

      @Deprecated @Contract("_ -> fail") void setSkullType(SkullType skullType)
      已过时。
      请检查 Material 类型
      设置头颅的类型.

      原文: Sets the type of skull

      参数:
      skullType - 头颅的类型