Class BlockEntitySign

All Implemented Interfaces:
Cloneable

public class BlockEntitySign extends BlockEntitySpawnable
Author:
MagicDroidX (Nukkit Project)
  • Field Details

  • Constructor Details

  • Method Details

    • loadNBT

      @Since("1.19.60-r1") public void loadNBT()
      Description copied from class: BlockEntity
      从方块实体的namedtag中读取数据
      Overrides:
      loadNBT in class BlockEntity
    • saveNBT

      public void saveNBT()
      Description copied from class: BlockEntity
      存储方块实体数据到namedtag
      Overrides:
      saveNBT in class BlockEntity
    • isBlockEntityValid

      public boolean isBlockEntityValid()
      Specified by:
      isBlockEntityValid in class BlockEntity
    • setText

      public boolean setText(String... lines)
    • setText

      public boolean setText(boolean front, String... lines)
      设置lines文本数组到Sign对象,同时更新NBT
      Parameters:
      front - the front
      lines - the lines
      Returns:
      the text
    • getText

      public String[] getText()
    • getText

      public String[] getText(boolean front)
    • getEditorEntityRuntimeId

      public long getEditorEntityRuntimeId()
      设置编辑此告示牌的玩家的运行时实体 ID。只有此玩家才能编辑告示牌。这用于防止多个玩家同时编辑同一告示牌,并防止玩家编辑他们未放置的告示牌。

      Sets the runtime entity ID of the player editing this sign. Only this player will be able to edit the sign. This is used to prevent multiple players from editing the same sign at the same time, and to prevent players from editing signs they didn't place.

    • setEditorEntityRuntimeId

      public void setEditorEntityRuntimeId(Long editorEntityRuntimeId)
    • getColor

      public BlockColor getColor()
    • getColor

      public BlockColor getColor(boolean front)
    • setColor

      public void setColor(BlockColor color)
    • setColor

      public void setColor(boolean front, BlockColor color)
    • isGlowing

      public boolean isGlowing()
    • isGlowing

      public boolean isGlowing(boolean front)
    • setGlowing

      public void setGlowing(boolean glowing)
    • setGlowing

      public void setGlowing(boolean front, boolean glowing)
    • updateCompoundTag

      public boolean updateCompoundTag(CompoundTag nbt, Player player)
      Description copied from class: BlockEntitySpawnable
      Called when a player updates a block entity's NBT data for example when writing on a sign.
      Overrides:
      updateCompoundTag in class BlockEntitySpawnable
      Parameters:
      nbt - tag
      player - player
      Returns:
      bool indication of success, will respawn the tile to the player if false.
    • getSpawnCompound

      public CompoundTag getSpawnCompound()
      Overrides:
      getSpawnCompound in class BlockEntitySpawnable