Class SignBlockEntity

java.lang.Object
net.minecraft.block.entity.BlockEntity
net.minecraft.block.entity.SignBlockEntity
Direct Known Subclasses:
HangingSignBlockEntity

public class SignBlockEntity extends BlockEntity
Mappings:
Namespace Name
official cxp
intermediary net/minecraft/class_2625
named net/minecraft/block/entity/SignBlockEntity
  • Field Details

    • TEXT_COUNT

      public static final int TEXT_COUNT
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Lcxp;a:I
      intermediary field_31362 Lnet/minecraft/class_2625;field_31362:I
      named TEXT_COUNT Lnet/minecraft/block/entity/SignBlockEntity;TEXT_COUNT:I
    • MAX_TEXT_WIDTH

      private static final int MAX_TEXT_WIDTH
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official b Lcxp;b:I
      intermediary field_40335 Lnet/minecraft/class_2625;field_40335:I
      named MAX_TEXT_WIDTH Lnet/minecraft/block/entity/SignBlockEntity;MAX_TEXT_WIDTH:I
    • TEXT_LINE_HEIGHT

      private static final int TEXT_LINE_HEIGHT
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official c Lcxp;c:I
      intermediary field_40336 Lnet/minecraft/class_2625;field_40336:I
      named TEXT_LINE_HEIGHT Lnet/minecraft/block/entity/SignBlockEntity;TEXT_LINE_HEIGHT:I
    • TEXT_KEYS

      private static final String[] TEXT_KEYS
      Mappings:
      Namespace Name Mixin selector
      official d Lcxp;d:[Ljava/lang/String;
      intermediary field_28905 Lnet/minecraft/class_2625;field_28905:[Ljava/lang/String;
      named TEXT_KEYS Lnet/minecraft/block/entity/SignBlockEntity;TEXT_KEYS:[Ljava/lang/String;
    • FILTERED_TEXT_KEYS

      private static final String[] FILTERED_TEXT_KEYS
      Mappings:
      Namespace Name Mixin selector
      official e Lcxp;e:[Ljava/lang/String;
      intermediary field_28906 Lnet/minecraft/class_2625;field_28906:[Ljava/lang/String;
      named FILTERED_TEXT_KEYS Lnet/minecraft/block/entity/SignBlockEntity;FILTERED_TEXT_KEYS:[Ljava/lang/String;
    • texts

      private final Text[] texts
      Mappings:
      Namespace Name Mixin selector
      official f Lcxp;f:[Lss;
      intermediary field_12050 Lnet/minecraft/class_2625;field_12050:[Lnet/minecraft/class_2561;
      named texts Lnet/minecraft/block/entity/SignBlockEntity;texts:[Lnet/minecraft/text/Text;
    • filteredTexts

      private final Text[] filteredTexts
      Mappings:
      Namespace Name Mixin selector
      official g Lcxp;g:[Lss;
      intermediary field_28907 Lnet/minecraft/class_2625;field_28907:[Lnet/minecraft/class_2561;
      named filteredTexts Lnet/minecraft/block/entity/SignBlockEntity;filteredTexts:[Lnet/minecraft/text/Text;
    • editable

      private boolean editable
      Mappings:
      Namespace Name Mixin selector
      official h Lcxp;h:Z
      intermediary field_12048 Lnet/minecraft/class_2625;field_12048:Z
      named editable Lnet/minecraft/block/entity/SignBlockEntity;editable:Z
    • editor

      @Nullable private @Nullable UUID editor
      Mappings:
      Namespace Name Mixin selector
      official i Lcxp;i:Ljava/util/UUID;
      intermediary field_12046 Lnet/minecraft/class_2625;field_12046:Ljava/util/UUID;
      named editor Lnet/minecraft/block/entity/SignBlockEntity;editor:Ljava/util/UUID;
    • textsBeingEdited

      @Nullable private @Nullable OrderedText[] textsBeingEdited
      Mappings:
      Namespace Name Mixin selector
      official j Lcxp;j:[Lano;
      intermediary field_12049 Lnet/minecraft/class_2625;field_12049:[Lnet/minecraft/class_5481;
      named textsBeingEdited Lnet/minecraft/block/entity/SignBlockEntity;textsBeingEdited:[Lnet/minecraft/text/OrderedText;
    • filterText

      private boolean filterText
      Mappings:
      Namespace Name Mixin selector
      official k Lcxp;k:Z
      intermediary field_28908 Lnet/minecraft/class_2625;field_28908:Z
      named filterText Lnet/minecraft/block/entity/SignBlockEntity;filterText:Z
    • textColor

      private DyeColor textColor
      Mappings:
      Namespace Name Mixin selector
      official l Lcxp;l:Lccl;
      intermediary field_16419 Lnet/minecraft/class_2625;field_16419:Lnet/minecraft/class_1767;
      named textColor Lnet/minecraft/block/entity/SignBlockEntity;textColor:Lnet/minecraft/util/DyeColor;
    • glowingText

      private boolean glowingText
      Mappings:
      Namespace Name Mixin selector
      official m Lcxp;m:Z
      intermediary field_29225 Lnet/minecraft/class_2625;field_29225:Z
      named glowingText Lnet/minecraft/block/entity/SignBlockEntity;glowingText:Z
  • Constructor Details

    • SignBlockEntity

      public SignBlockEntity(BlockPos pos, BlockState state)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lcxp;<init>(Lgp;Lcyt;)V
      intermediary <init> Lnet/minecraft/class_2625;<init>(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
      named <init> Lnet/minecraft/block/entity/SignBlockEntity;<init>(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
    • SignBlockEntity

      public SignBlockEntity(BlockEntityType type, BlockPos pos, BlockState state)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lcwl;<init>(Lcwn;Lgp;Lcyt;)V
      intermediary <init> Lnet/minecraft/class_2586;<init>(Lnet/minecraft/class_2591;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)V
      named <init> Lnet/minecraft/block/entity/BlockEntity;<init>(Lnet/minecraft/block/entity/BlockEntityType;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
  • Method Details

    • getTextLineHeight

      public int getTextLineHeight()
      Mappings:
      Namespace Name Mixin selector
      official c Lcxp;c()I
      intermediary method_45469 Lnet/minecraft/class_2625;method_45469()I
      named getTextLineHeight Lnet/minecraft/block/entity/SignBlockEntity;getTextLineHeight()I
    • getMaxTextWidth

      public int getMaxTextWidth()
      Mappings:
      Namespace Name Mixin selector
      official d Lcxp;d()I
      intermediary method_45470 Lnet/minecraft/class_2625;method_45470()I
      named getMaxTextWidth Lnet/minecraft/block/entity/SignBlockEntity;getMaxTextWidth()I
    • writeNbt

      protected void writeNbt(NbtCompound nbt)
      Writes data to nbt. Subclasses should override this if they store a persistent data.

      NBT is a storage format; therefore, a data from NBT is loaded to a block entity instance's fields, which are used for other operations instead of the NBT. The data is written back to NBT when saving the block entity.

      Overrides:
      writeNbt in class BlockEntity
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official b Lcwl;b(Lqp;)V
      intermediary method_11007 Lnet/minecraft/class_2586;method_11007(Lnet/minecraft/class_2487;)V
      named writeNbt Lnet/minecraft/block/entity/BlockEntity;writeNbt(Lnet/minecraft/nbt/NbtCompound;)V
    • readNbt

      public void readNbt(NbtCompound nbt)
      Reads data from nbt. Subclasses should override this if they store a persistent data.

      NBT is a storage format; therefore, a data from NBT is loaded to a block entity instance's fields, which are used for other operations instead of the NBT. The data is written back to NBT when saving the block entity.

      nbt might not have all expected keys, or might have a key whose value does not meet the requirement (such as the type or the range). This method should fall back to a reasonable default value instead of throwing an exception.

      Overrides:
      readNbt in class BlockEntity
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Lcwl;a(Lqp;)V
      intermediary method_11014 Lnet/minecraft/class_2586;method_11014(Lnet/minecraft/class_2487;)V
      named readNbt Lnet/minecraft/block/entity/BlockEntity;readNbt(Lnet/minecraft/nbt/NbtCompound;)V
    • parseTextFromJson

      private Text parseTextFromJson(String json)
      Mappings:
      Namespace Name Mixin selector
      official a Lcxp;a(Ljava/lang/String;)Lss;
      intermediary method_33828 Lnet/minecraft/class_2625;method_33828(Ljava/lang/String;)Lnet/minecraft/class_2561;
      named parseTextFromJson Lnet/minecraft/block/entity/SignBlockEntity;parseTextFromJson(Ljava/lang/String;)Lnet/minecraft/text/Text;
    • unparsedTextFromJson

      private Text unparsedTextFromJson(String json)
      Mappings:
      Namespace Name Mixin selector
      official b Lcxp;b(Ljava/lang/String;)Lss;
      intermediary method_33384 Lnet/minecraft/class_2625;method_33384(Ljava/lang/String;)Lnet/minecraft/class_2561;
      named unparsedTextFromJson Lnet/minecraft/block/entity/SignBlockEntity;unparsedTextFromJson(Ljava/lang/String;)Lnet/minecraft/text/Text;
    • getTextOnRow

      public Text getTextOnRow(int row, boolean filtered)
      Mappings:
      Namespace Name Mixin selector
      official a Lcxp;a(IZ)Lss;
      intermediary method_30843 Lnet/minecraft/class_2625;method_30843(IZ)Lnet/minecraft/class_2561;
      named getTextOnRow Lnet/minecraft/block/entity/SignBlockEntity;getTextOnRow(IZ)Lnet/minecraft/text/Text;
    • setTextOnRow

      public void setTextOnRow(int row, Text text)
      Mappings:
      Namespace Name Mixin selector
      official a Lcxp;a(ILss;)V
      intermediary method_11299 Lnet/minecraft/class_2625;method_11299(ILnet/minecraft/class_2561;)V
      named setTextOnRow Lnet/minecraft/block/entity/SignBlockEntity;setTextOnRow(ILnet/minecraft/text/Text;)V
    • setTextOnRow

      public void setTextOnRow(int row, Text text, Text filteredText)
      Mappings:
      Namespace Name Mixin selector
      official a Lcxp;a(ILss;Lss;)V
      intermediary method_33827 Lnet/minecraft/class_2625;method_33827(ILnet/minecraft/class_2561;Lnet/minecraft/class_2561;)V
      named setTextOnRow Lnet/minecraft/block/entity/SignBlockEntity;setTextOnRow(ILnet/minecraft/text/Text;Lnet/minecraft/text/Text;)V
    • updateSign

      public OrderedText[] updateSign(boolean filterText, Function<Text,OrderedText> textOrderingFunction)
      Mappings:
      Namespace Name Mixin selector
      official a Lcxp;a(ZLjava/util/function/Function;)[Lano;
      intermediary method_33829 Lnet/minecraft/class_2625;method_33829(ZLjava/util/function/Function;)[Lnet/minecraft/class_5481;
      named updateSign Lnet/minecraft/block/entity/SignBlockEntity;updateSign(ZLjava/util/function/Function;)[Lnet/minecraft/text/OrderedText;
    • getTexts

      private Text[] getTexts(boolean filtered)
      Mappings:
      Namespace Name Mixin selector
      official c Lcxp;c(Z)[Lss;
      intermediary method_33830 Lnet/minecraft/class_2625;method_33830(Z)[Lnet/minecraft/class_2561;
      named getTexts Lnet/minecraft/block/entity/SignBlockEntity;getTexts(Z)[Lnet/minecraft/text/Text;
    • toUpdatePacket

      public BlockEntityUpdateS2CPacket toUpdatePacket()
      Description copied from class: BlockEntity
      Returns the packet to send to nearby players when the block entity's observable state changes, or null to not send the packet.

      If the data returned by initial chunk data is suitable for updates, the following shortcut can be used to create an update packet: BlockEntityUpdateS2CPacket.create(this). The NBT will be passed to BlockEntity.readNbt(net.minecraft.nbt.NbtCompound) on the client.

      "Observable state" is a state that clients can observe without specific interaction. For example, CampfireBlockEntity's cooked items are observable states, but chests' inventories are not observable states, since the player must first open that chest before they can see the contents.

      To sync block entity data using this method, use serverWorld.getChunkManager().markForUpdate(this.getPos());.

      Overrides:
      toUpdatePacket in class BlockEntity
      Returns:
      the packet to send to nearby players when the block entity's observable state changes, or null to not send the packet
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official f Lcxp;f()Lus;
      intermediary method_38249 Lnet/minecraft/class_2625;method_38249()Lnet/minecraft/class_2622;
      named toUpdatePacket Lnet/minecraft/block/entity/SignBlockEntity;toUpdatePacket()Lnet/minecraft/network/packet/s2c/play/BlockEntityUpdateS2CPacket;
    • toInitialChunkDataNbt

      public NbtCompound toInitialChunkDataNbt()
      Returns the serialized state of this block entity that is observable by clients.

      This is sent alongside the initial chunk data, as well as when the block entity implements BlockEntity.toUpdatePacket() and decides to use the default BlockEntityUpdateS2CPacket.

      "Observable state" is a state that clients can observe without specific interaction. For example, CampfireBlockEntity's cooked items are observable states, but chests' inventories are not observable states, since the player must first open that chest before they can see the contents.

      To send all NBT data of this block entity saved to disk, return BlockEntity.createNbt().

      Overrides:
      toInitialChunkDataNbt in class BlockEntity
      Returns:
      the serialized state of this block entity that is observable by clients
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official ad_ Lcwl;ad_()Lqp;
      intermediary method_16887 Lnet/minecraft/class_2586;method_16887()Lnet/minecraft/class_2487;
      named toInitialChunkDataNbt Lnet/minecraft/block/entity/BlockEntity;toInitialChunkDataNbt()Lnet/minecraft/nbt/NbtCompound;
    • copyItemDataRequiresOperator

      public boolean copyItemDataRequiresOperator()
      Returns whether the block item should require the player to have operator permissions to copy the block entity data on placement.

      Block entities that can execute commands should override this to return true.

      Overrides:
      copyItemDataRequiresOperator in class BlockEntity
      Returns:
      whether the block item should require the player to have operator permissions to copy the block entity data on placement
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official u Lcwl;u()Z
      intermediary method_11011 Lnet/minecraft/class_2586;method_11011()Z
      named copyItemDataRequiresOperator Lnet/minecraft/block/entity/BlockEntity;copyItemDataRequiresOperator()Z
    • isEditable

      public boolean isEditable()
      Mappings:
      Namespace Name Mixin selector
      official g Lcxp;g()Z
      intermediary method_11307 Lnet/minecraft/class_2625;method_11307()Z
      named isEditable Lnet/minecraft/block/entity/SignBlockEntity;isEditable()Z
    • setEditable

      public void setEditable(boolean editable)
      Mappings:
      Namespace Name Mixin selector
      official a Lcxp;a(Z)V
      intermediary method_11303 Lnet/minecraft/class_2625;method_11303(Z)V
      named setEditable Lnet/minecraft/block/entity/SignBlockEntity;setEditable(Z)V
    • setEditor

      public void setEditor(UUID editor)
      Mappings:
      Namespace Name Mixin selector
      official a Lcxp;a(Ljava/util/UUID;)V
      intermediary method_11306 Lnet/minecraft/class_2625;method_11306(Ljava/util/UUID;)V
      named setEditor Lnet/minecraft/block/entity/SignBlockEntity;setEditor(Ljava/util/UUID;)V
    • getEditor

      @Nullable public @Nullable UUID getEditor()
      Mappings:
      Namespace Name Mixin selector
      official i Lcxp;i()Ljava/util/UUID;
      intermediary method_11305 Lnet/minecraft/class_2625;method_11305()Ljava/util/UUID;
      named getEditor Lnet/minecraft/block/entity/SignBlockEntity;getEditor()Ljava/util/UUID;
    • shouldRunCommand

      public boolean shouldRunCommand(PlayerEntity player)
      Mappings:
      Namespace Name Mixin selector
      official a Lcxp;a(Lbwp;)Z
      intermediary method_45473 Lnet/minecraft/class_2625;method_45473(Lnet/minecraft/class_1657;)Z
      named shouldRunCommand Lnet/minecraft/block/entity/SignBlockEntity;shouldRunCommand(Lnet/minecraft/entity/player/PlayerEntity;)Z
    • onActivate

      public boolean onActivate(ServerPlayerEntity player)
      Mappings:
      Namespace Name Mixin selector
      official a Lcxp;a(Lahn;)Z
      intermediary method_11301 Lnet/minecraft/class_2625;method_11301(Lnet/minecraft/class_3222;)Z
      named onActivate Lnet/minecraft/block/entity/SignBlockEntity;onActivate(Lnet/minecraft/server/network/ServerPlayerEntity;)Z
    • getCommandSource

      public ServerCommandSource getCommandSource(@Nullable @Nullable ServerPlayerEntity player)
      Mappings:
      Namespace Name Mixin selector
      official b Lcxp;b(Lahn;)Ldn;
      intermediary method_11304 Lnet/minecraft/class_2625;method_11304(Lnet/minecraft/class_3222;)Lnet/minecraft/class_2168;
      named getCommandSource Lnet/minecraft/block/entity/SignBlockEntity;getCommandSource(Lnet/minecraft/server/network/ServerPlayerEntity;)Lnet/minecraft/server/command/ServerCommandSource;
    • getTextColor

      public DyeColor getTextColor()
      Mappings:
      Namespace Name Mixin selector
      official j Lcxp;j()Lccl;
      intermediary method_16126 Lnet/minecraft/class_2625;method_16126()Lnet/minecraft/class_1767;
      named getTextColor Lnet/minecraft/block/entity/SignBlockEntity;getTextColor()Lnet/minecraft/util/DyeColor;
    • setTextColor

      public boolean setTextColor(DyeColor value)
      Mappings:
      Namespace Name Mixin selector
      official a Lcxp;a(Lccl;)Z
      intermediary method_16127 Lnet/minecraft/class_2625;method_16127(Lnet/minecraft/class_1767;)Z
      named setTextColor Lnet/minecraft/block/entity/SignBlockEntity;setTextColor(Lnet/minecraft/util/DyeColor;)Z
    • isGlowingText

      public boolean isGlowingText()
      Mappings:
      Namespace Name Mixin selector
      official t Lcxp;t()Z
      intermediary method_34271 Lnet/minecraft/class_2625;method_34271()Z
      named isGlowingText Lnet/minecraft/block/entity/SignBlockEntity;isGlowingText()Z
    • setGlowingText

      public boolean setGlowingText(boolean glowingText)
      Mappings:
      Namespace Name Mixin selector
      official b Lcxp;b(Z)Z
      intermediary method_34270 Lnet/minecraft/class_2625;method_34270(Z)Z
      named setGlowingText Lnet/minecraft/block/entity/SignBlockEntity;setGlowingText(Z)Z
    • updateListeners

      private void updateListeners()
      Mappings:
      Namespace Name Mixin selector
      official w Lcxp;w()V
      intermediary method_34272 Lnet/minecraft/class_2625;method_34272()V
      named updateListeners Lnet/minecraft/block/entity/SignBlockEntity;updateListeners()V