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
named net/minecraft/block/entity/SignBlockEntity
intermediary net/minecraft/class_2625
official dwj
  • Field Details

    • LOGGER

      private static final Logger LOGGER
      Mappings:
      Namespace Name Mixin selector
      named LOGGER Lnet/minecraft/block/entity/SignBlockEntity;LOGGER:Lorg/slf4j/Logger;
      intermediary field_43294 Lnet/minecraft/class_2625;field_43294:Lorg/slf4j/Logger;
      official a Ldwj;a:Lorg/slf4j/Logger;
    • MAX_TEXT_WIDTH

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

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

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

      private SignText frontText
      Mappings:
      Namespace Name Mixin selector
      named frontText Lnet/minecraft/block/entity/SignBlockEntity;frontText:Lnet/minecraft/block/entity/SignText;
      intermediary field_43295 Lnet/minecraft/class_2625;field_43295:Lnet/minecraft/class_8242;
      official e Ldwj;e:Ldwk;
    • backText

      private SignText backText
      Mappings:
      Namespace Name Mixin selector
      named backText Lnet/minecraft/block/entity/SignBlockEntity;backText:Lnet/minecraft/block/entity/SignText;
      intermediary field_43296 Lnet/minecraft/class_2625;field_43296:Lnet/minecraft/class_8242;
      official f Ldwj;f:Ldwk;
    • waxed

      private boolean waxed
      Mappings:
      Namespace Name Mixin selector
      named waxed Lnet/minecraft/block/entity/SignBlockEntity;waxed:Z
      intermediary field_43297 Lnet/minecraft/class_2625;field_43297:Z
      official g Ldwj;g:Z
  • Constructor Details

    • SignBlockEntity

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

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

    • createText

      protected SignText createText()
      Mappings:
      Namespace Name Mixin selector
      named createText Lnet/minecraft/block/entity/SignBlockEntity;createText()Lnet/minecraft/block/entity/SignText;
      intermediary method_49852 Lnet/minecraft/class_2625;method_49852()Lnet/minecraft/class_8242;
      official f Ldwj;f()Ldwk;
    • isPlayerFacingFront

      public boolean isPlayerFacingFront(PlayerEntity player)
      Mappings:
      Namespace Name Mixin selector
      named isPlayerFacingFront Lnet/minecraft/block/entity/SignBlockEntity;isPlayerFacingFront(Lnet/minecraft/entity/player/PlayerEntity;)Z
      intermediary method_49834 Lnet/minecraft/class_2625;method_49834(Lnet/minecraft/class_1657;)Z
      official a Ldwj;a(Lcpw;)Z
    • getText

      public SignText getText(boolean front)
      Mappings:
      Namespace Name Mixin selector
      named getText Lnet/minecraft/block/entity/SignBlockEntity;getText(Z)Lnet/minecraft/block/entity/SignText;
      intermediary method_49843 Lnet/minecraft/class_2625;method_49843(Z)Lnet/minecraft/class_8242;
      official a Ldwj;a(Z)Ldwk;
    • getFrontText

      public SignText getFrontText()
      Mappings:
      Namespace Name Mixin selector
      named getFrontText Lnet/minecraft/block/entity/SignBlockEntity;getFrontText()Lnet/minecraft/block/entity/SignText;
      intermediary method_49853 Lnet/minecraft/class_2625;method_49853()Lnet/minecraft/class_8242;
      official j Ldwj;j()Ldwk;
    • getBackText

      public SignText getBackText()
      Mappings:
      Namespace Name Mixin selector
      named getBackText Lnet/minecraft/block/entity/SignBlockEntity;getBackText()Lnet/minecraft/block/entity/SignText;
      intermediary method_49854 Lnet/minecraft/class_2625;method_49854()Lnet/minecraft/class_8242;
      official k Ldwj;k()Ldwk;
    • getTextLineHeight

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

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

      protected void writeNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registries)
      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
      named writeNbt Lnet/minecraft/block/entity/BlockEntity;writeNbt(Lnet/minecraft/nbt/NbtCompound;Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)V
      intermediary method_11007 Lnet/minecraft/class_2586;method_11007(Lnet/minecraft/class_2487;Lnet/minecraft/class_7225$class_7874;)V
      official b Lduw;b(Lux;Ljs$a;)V
    • readNbt

      protected void readNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registries)
      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
      named readNbt Lnet/minecraft/block/entity/BlockEntity;readNbt(Lnet/minecraft/nbt/NbtCompound;Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)V
      intermediary method_11014 Lnet/minecraft/class_2586;method_11014(Lnet/minecraft/class_2487;Lnet/minecraft/class_7225$class_7874;)V
      official a Lduw;a(Lux;Ljs$a;)V
    • parseLines

      private SignText parseLines(SignText signText)
      Mappings:
      Namespace Name Mixin selector
      named parseLines Lnet/minecraft/block/entity/SignBlockEntity;parseLines(Lnet/minecraft/block/entity/SignText;)Lnet/minecraft/block/entity/SignText;
      intermediary method_50008 Lnet/minecraft/class_2625;method_50008(Lnet/minecraft/class_8242;)Lnet/minecraft/class_8242;
      official a Ldwj;a(Ldwk;)Ldwk;
    • parseLine

      private Text parseLine(Text text)
      Mappings:
      Namespace Name Mixin selector
      named parseLine Lnet/minecraft/block/entity/SignBlockEntity;parseLine(Lnet/minecraft/text/Text;)Lnet/minecraft/text/Text;
      intermediary method_50009 Lnet/minecraft/class_2625;method_50009(Lnet/minecraft/class_2561;)Lnet/minecraft/class_2561;
      official a Ldwj;a(Lxv;)Lxv;
    • tryChangeText

      public void tryChangeText(PlayerEntity player, boolean front, List<FilteredMessage> messages)
      Mappings:
      Namespace Name Mixin selector
      named tryChangeText Lnet/minecraft/block/entity/SignBlockEntity;tryChangeText(Lnet/minecraft/entity/player/PlayerEntity;ZLjava/util/List;)V
      intermediary method_49836 Lnet/minecraft/class_2625;method_49836(Lnet/minecraft/class_1657;ZLjava/util/List;)V
      official a Ldwj;a(Lcpw;ZLjava/util/List;)V
    • changeText

      public boolean changeText(UnaryOperator<SignText> textChanger, boolean front)
      Mappings:
      Namespace Name Mixin selector
      named changeText Lnet/minecraft/block/entity/SignBlockEntity;changeText(Ljava/util/function/UnaryOperator;Z)Z
      intermediary method_49841 Lnet/minecraft/class_2625;method_49841(Ljava/util/function/UnaryOperator;Z)Z
      official a Ldwj;a(Ljava/util/function/UnaryOperator;Z)Z
    • getTextWithMessages

      private SignText getTextWithMessages(PlayerEntity player, List<FilteredMessage> messages, SignText text)
      Mappings:
      Namespace Name Mixin selector
      named getTextWithMessages Lnet/minecraft/block/entity/SignBlockEntity;getTextWithMessages(Lnet/minecraft/entity/player/PlayerEntity;Ljava/util/List;Lnet/minecraft/block/entity/SignText;)Lnet/minecraft/block/entity/SignText;
      intermediary method_49835 Lnet/minecraft/class_2625;method_49835(Lnet/minecraft/class_1657;Ljava/util/List;Lnet/minecraft/class_8242;)Lnet/minecraft/class_8242;
      official a Ldwj;a(Lcpw;Ljava/util/List;Ldwk;)Ldwk;
    • setText

      public boolean setText(SignText text, boolean front)
      Mappings:
      Namespace Name Mixin selector
      named setText Lnet/minecraft/block/entity/SignBlockEntity;setText(Lnet/minecraft/block/entity/SignText;Z)Z
      intermediary method_49840 Lnet/minecraft/class_2625;method_49840(Lnet/minecraft/class_8242;Z)Z
      official a Ldwj;a(Ldwk;Z)Z
    • setBackText

      private boolean setBackText(SignText backText)
      Mappings:
      Namespace Name Mixin selector
      named setBackText Lnet/minecraft/block/entity/SignBlockEntity;setBackText(Lnet/minecraft/block/entity/SignText;)Z
      intermediary method_49839 Lnet/minecraft/class_2625;method_49839(Lnet/minecraft/class_8242;)Z
      official b Ldwj;b(Ldwk;)Z
    • setFrontText

      private boolean setFrontText(SignText frontText)
      Mappings:
      Namespace Name Mixin selector
      named setFrontText Lnet/minecraft/block/entity/SignBlockEntity;setFrontText(Lnet/minecraft/block/entity/SignText;)Z
      intermediary method_49846 Lnet/minecraft/class_2625;method_49846(Lnet/minecraft/class_8242;)Z
      official c Ldwj;c(Ldwk;)Z
    • canRunCommandClickEvent

      public boolean canRunCommandClickEvent(boolean front, PlayerEntity player)
      Mappings:
      Namespace Name Mixin selector
      named canRunCommandClickEvent Lnet/minecraft/block/entity/SignBlockEntity;canRunCommandClickEvent(ZLnet/minecraft/entity/player/PlayerEntity;)Z
      intermediary method_50010 Lnet/minecraft/class_2625;method_50010(ZLnet/minecraft/class_1657;)Z
      official a Ldwj;a(ZLcpw;)Z
    • runCommandClickEvent

      public boolean runCommandClickEvent(PlayerEntity player, World world, BlockPos pos, boolean front)
      Mappings:
      Namespace Name Mixin selector
      named runCommandClickEvent Lnet/minecraft/block/entity/SignBlockEntity;runCommandClickEvent(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Z)Z
      intermediary method_50007 Lnet/minecraft/class_2625;method_50007(Lnet/minecraft/class_1657;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Z)Z
      official a Ldwj;a(Lcpw;Ldhh;Ljh;Z)Z
    • createCommandSource

      private static ServerCommandSource createCommandSource(@Nullable @Nullable PlayerEntity player, World world, BlockPos pos)
      Mappings:
      Namespace Name Mixin selector
      named createCommandSource Lnet/minecraft/block/entity/SignBlockEntity;createCommandSource(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/server/command/ServerCommandSource;
      intermediary method_50006 Lnet/minecraft/class_2625;method_50006(Lnet/minecraft/class_1657;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)Lnet/minecraft/class_2168;
      official a Ldwj;a(Lcpw;Ldhh;Ljh;)Lew;
    • 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, net.minecraft.registry.RegistryWrapper.WrapperLookup) 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
      named toUpdatePacket Lnet/minecraft/block/entity/SignBlockEntity;toUpdatePacket()Lnet/minecraft/network/packet/s2c/play/BlockEntityUpdateS2CPacket;
      intermediary method_38249 Lnet/minecraft/class_2625;method_38249()Lnet/minecraft/class_2622;
      official t Ldwj;t()Lacy;
    • toInitialChunkDataNbt

      public NbtCompound toInitialChunkDataNbt(RegistryWrapper.WrapperLookup registries)
      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 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(net.minecraft.registry.RegistryWrapper.WrapperLookup).

      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
      named toInitialChunkDataNbt Lnet/minecraft/block/entity/BlockEntity;toInitialChunkDataNbt(Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)Lnet/minecraft/nbt/NbtCompound;
      intermediary method_16887 Lnet/minecraft/class_2586;method_16887(Lnet/minecraft/class_7225$class_7874;)Lnet/minecraft/class_2487;
      official a Lduw;a(Ljs$a;)Lux;
    • 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
      named copyItemDataRequiresOperator Lnet/minecraft/block/entity/BlockEntity;copyItemDataRequiresOperator()Z
      intermediary method_11011 Lnet/minecraft/class_2586;method_11011()Z
      official p Lduw;p()Z
    • setEditor

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

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

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

      public boolean isWaxed()
      Mappings:
      Namespace Name Mixin selector
      named isWaxed Lnet/minecraft/block/entity/SignBlockEntity;isWaxed()Z
      intermediary method_49855 Lnet/minecraft/class_2625;method_49855()Z
      official v Ldwj;v()Z
    • setWaxed

      public boolean setWaxed(boolean waxed)
      Mappings:
      Namespace Name Mixin selector
      named setWaxed Lnet/minecraft/block/entity/SignBlockEntity;setWaxed(Z)Z
      intermediary method_49849 Lnet/minecraft/class_2625;method_49849(Z)Z
      official b Ldwj;b(Z)Z
    • isPlayerTooFarToEdit

      public boolean isPlayerTooFarToEdit(UUID uuid)
      Mappings:
      Namespace Name Mixin selector
      named isPlayerTooFarToEdit Lnet/minecraft/block/entity/SignBlockEntity;isPlayerTooFarToEdit(Ljava/util/UUID;)Z
      intermediary method_49847 Lnet/minecraft/class_2625;method_49847(Ljava/util/UUID;)Z
      official b Ldwj;b(Ljava/util/UUID;)Z
    • tick

      public static void tick(World world, BlockPos pos, BlockState state, SignBlockEntity blockEntity)
      Mappings:
      Namespace Name Mixin selector
      named tick Lnet/minecraft/block/entity/SignBlockEntity;tick(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/block/entity/SignBlockEntity;)V
      intermediary method_49837 Lnet/minecraft/class_2625;method_49837(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_2625;)V
      official a Ldwj;a(Ldhh;Ljh;Ldxu;Ldwj;)V
    • tryClearInvalidEditor

      private void tryClearInvalidEditor(SignBlockEntity blockEntity, World world, UUID uuid)
      Mappings:
      Namespace Name Mixin selector
      named tryClearInvalidEditor Lnet/minecraft/block/entity/SignBlockEntity;tryClearInvalidEditor(Lnet/minecraft/block/entity/SignBlockEntity;Lnet/minecraft/world/World;Ljava/util/UUID;)V
      intermediary method_49838 Lnet/minecraft/class_2625;method_49838(Lnet/minecraft/class_2625;Lnet/minecraft/class_1937;Ljava/util/UUID;)V
      official a Ldwj;a(Ldwj;Ldhh;Ljava/util/UUID;)V
    • getInteractionFailSound

      public SoundEvent getInteractionFailSound()
      Mappings:
      Namespace Name Mixin selector
      named getInteractionFailSound Lnet/minecraft/block/entity/SignBlockEntity;getInteractionFailSound()Lnet/minecraft/sound/SoundEvent;
      intermediary method_54303 Lnet/minecraft/class_2625;method_54303()Lnet/minecraft/class_3414;
      official d Ldwj;d()Laxe;