Class SignBlockEntity
- Direct Known Subclasses:
HangingSignBlockEntity
- Mappings:
Namespace Name named net/minecraft/block/entity/SignBlockEntityintermediary net/minecraft/class_2625official drs
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.block.entity.BlockEntity
BlockEntity.ComponentsAccess -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate SignTextprivate SignTextprivate static final Loggerprivate static final intprivate static final intprivate booleanFields inherited from class net.minecraft.block.entity.BlockEntity
pos, removed, world -
Constructor Summary
ConstructorsConstructorDescriptionSignBlockEntity(BlockEntityType type, BlockPos pos, BlockState state) SignBlockEntity(BlockPos pos, BlockState state) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanRunCommandClickEvent(boolean front, PlayerEntity player) booleanchangeText(UnaryOperator<SignText> textChanger, boolean front) booleanReturns whether the block item should require the player to have operator permissions to copy the block entity data on placement.private static ServerCommandSourcecreateCommandSource(@Nullable PlayerEntity player, World world, BlockPos pos) protected SignTextintgetText(boolean front) intprivate SignTextgetTextWithMessages(PlayerEntity player, List<FilteredMessage> messages, SignText text) booleanisPlayerFacingFront(PlayerEntity player) booleanisPlayerTooFarToEdit(UUID uuid) booleanisWaxed()private Textprivate SignTextparseLines(SignText signText) protected voidreadNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registryLookup) Reads data fromnbt.booleanrunCommandClickEvent(PlayerEntity player, World world, BlockPos pos, boolean front) private booleansetBackText(SignText backText) voidprivate booleansetFrontText(SignText frontText) booleanbooleansetWaxed(boolean waxed) static voidtick(World world, BlockPos pos, BlockState state, SignBlockEntity blockEntity) toInitialChunkDataNbt(RegistryWrapper.WrapperLookup registryLookup) Returns the serialized state of this block entity that is observable by clients.Returns the packet to send to nearby players when the block entity's observable state changes, ornullto not send the packet.voidtryChangeText(PlayerEntity player, boolean front, List<FilteredMessage> messages) private voidtryClearInvalidEditor(SignBlockEntity blockEntity, World world, UUID uuid) private voidprotected voidwriteNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registryLookup) Writes data tonbt.Methods inherited from class net.minecraft.block.entity.BlockEntity
addComponents, cancelRemoval, createComponentlessNbt, createComponentlessNbtWithIdentifyingData, createComponentMap, createFromNbt, createNbt, createNbtWithId, createNbtWithIdentifyingData, getCachedState, getComponents, getPos, getType, getWorld, hasWorld, isRemoved, markDirty, markDirty, markRemoved, onSyncedBlockEvent, populateCrashReport, posFromNbt, read, readComponentlessNbt, readComponents, readComponents, readComponents, removeFromCopiedStackNbt, setCachedState, setComponents, setStackNbt, setWorld, tryParseCustomName, writeIdToNbt
-
Field Details
-
LOGGER
- Mappings:
Namespace Name Mixin selector named LOGGERLnet/minecraft/block/entity/SignBlockEntity;LOGGER:Lorg/slf4j/Logger;intermediary field_43294Lnet/minecraft/class_2625;field_43294:Lorg/slf4j/Logger;official aLdrs;a:Lorg/slf4j/Logger;
-
MAX_TEXT_WIDTH
private static final int MAX_TEXT_WIDTH- See Also:
- Mappings:
Namespace Name Mixin selector named MAX_TEXT_WIDTHLnet/minecraft/block/entity/SignBlockEntity;MAX_TEXT_WIDTH:Iintermediary field_40335Lnet/minecraft/class_2625;field_40335:Iofficial bLdrs;b:I
-
TEXT_LINE_HEIGHT
private static final int TEXT_LINE_HEIGHT- See Also:
- Mappings:
Namespace Name Mixin selector named TEXT_LINE_HEIGHTLnet/minecraft/block/entity/SignBlockEntity;TEXT_LINE_HEIGHT:Iintermediary field_40336Lnet/minecraft/class_2625;field_40336:Iofficial cLdrs;c:I
-
editor
- Mappings:
Namespace Name Mixin selector named editorLnet/minecraft/block/entity/SignBlockEntity;editor:Ljava/util/UUID;intermediary field_12046Lnet/minecraft/class_2625;field_12046:Ljava/util/UUID;official dLdrs;d:Ljava/util/UUID;
-
frontText
- Mappings:
Namespace Name Mixin selector named frontTextLnet/minecraft/block/entity/SignBlockEntity;frontText:Lnet/minecraft/block/entity/SignText;intermediary field_43295Lnet/minecraft/class_2625;field_43295:Lnet/minecraft/class_8242;official eLdrs;e:Ldrt;
-
backText
- Mappings:
Namespace Name Mixin selector named backTextLnet/minecraft/block/entity/SignBlockEntity;backText:Lnet/minecraft/block/entity/SignText;intermediary field_43296Lnet/minecraft/class_2625;field_43296:Lnet/minecraft/class_8242;official fLdrs;f:Ldrt;
-
waxed
private boolean waxed- Mappings:
Namespace Name Mixin selector named waxedLnet/minecraft/block/entity/SignBlockEntity;waxed:Zintermediary field_43297Lnet/minecraft/class_2625;field_43297:Zofficial gLdrs;g:Z
-
-
Constructor Details
-
SignBlockEntity
- Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/block/entity/SignBlockEntity;<init>(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Vintermediary <init>Lnet/minecraft/class_2625;<init>(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Vofficial <init>Ldrs;<init>(Ljd;Ldtc;)V
-
SignBlockEntity
- 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;)Vintermediary <init>Lnet/minecraft/class_2586;<init>(Lnet/minecraft/class_2591;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;)Vofficial <init>Ldqh;<init>(Ldqj;Ljd;Ldtc;)V
-
-
Method Details
-
createText
- Mappings:
Namespace Name Mixin selector named createTextLnet/minecraft/block/entity/SignBlockEntity;createText()Lnet/minecraft/block/entity/SignText;intermediary method_49852Lnet/minecraft/class_2625;method_49852()Lnet/minecraft/class_8242;official fLdrs;f()Ldrt;
-
isPlayerFacingFront
- Mappings:
Namespace Name Mixin selector named isPlayerFacingFrontLnet/minecraft/block/entity/SignBlockEntity;isPlayerFacingFront(Lnet/minecraft/entity/player/PlayerEntity;)Zintermediary method_49834Lnet/minecraft/class_2625;method_49834(Lnet/minecraft/class_1657;)Zofficial aLdrs;a(Lcmx;)Z
-
getText
- Mappings:
Namespace Name Mixin selector named getTextLnet/minecraft/block/entity/SignBlockEntity;getText(Z)Lnet/minecraft/block/entity/SignText;intermediary method_49843Lnet/minecraft/class_2625;method_49843(Z)Lnet/minecraft/class_8242;official aLdrs;a(Z)Ldrt;
-
getFrontText
- Mappings:
Namespace Name Mixin selector named getFrontTextLnet/minecraft/block/entity/SignBlockEntity;getFrontText()Lnet/minecraft/block/entity/SignText;intermediary method_49853Lnet/minecraft/class_2625;method_49853()Lnet/minecraft/class_8242;official jLdrs;j()Ldrt;
-
getBackText
- Mappings:
Namespace Name Mixin selector named getBackTextLnet/minecraft/block/entity/SignBlockEntity;getBackText()Lnet/minecraft/block/entity/SignText;intermediary method_49854Lnet/minecraft/class_2625;method_49854()Lnet/minecraft/class_8242;official kLdrs;k()Ldrt;
-
getTextLineHeight
public int getTextLineHeight()- Mappings:
Namespace Name Mixin selector named getTextLineHeightLnet/minecraft/block/entity/SignBlockEntity;getTextLineHeight()Iintermediary method_45469Lnet/minecraft/class_2625;method_45469()Iofficial bLdrs;b()I
-
getMaxTextWidth
public int getMaxTextWidth()- Mappings:
Namespace Name Mixin selector named getMaxTextWidthLnet/minecraft/block/entity/SignBlockEntity;getMaxTextWidth()Iintermediary method_45470Lnet/minecraft/class_2625;method_45470()Iofficial cLdrs;c()I
-
writeNbt
Writes data tonbt. 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:
writeNbtin classBlockEntity- See Also:
- Mappings:
Namespace Name Mixin selector named writeNbtLnet/minecraft/block/entity/BlockEntity;writeNbt(Lnet/minecraft/nbt/NbtCompound;Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)Vintermediary method_11007Lnet/minecraft/class_2586;method_11007(Lnet/minecraft/class_2487;Lnet/minecraft/class_7225$class_7874;)Vofficial bLdqh;b(Lub;Ljo$a;)V
-
readNbt
Reads data fromnbt. 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.
nbtmight 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:
readNbtin classBlockEntity- See Also:
- Mappings:
Namespace Name Mixin selector named readNbtLnet/minecraft/block/entity/BlockEntity;readNbt(Lnet/minecraft/nbt/NbtCompound;Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)Vintermediary method_11014Lnet/minecraft/class_2586;method_11014(Lnet/minecraft/class_2487;Lnet/minecraft/class_7225$class_7874;)Vofficial aLdqh;a(Lub;Ljo$a;)V
-
parseLines
- Mappings:
Namespace Name Mixin selector named parseLinesLnet/minecraft/block/entity/SignBlockEntity;parseLines(Lnet/minecraft/block/entity/SignText;)Lnet/minecraft/block/entity/SignText;intermediary method_50008Lnet/minecraft/class_2625;method_50008(Lnet/minecraft/class_8242;)Lnet/minecraft/class_8242;official aLdrs;a(Ldrt;)Ldrt;
-
parseLine
- Mappings:
Namespace Name Mixin selector named parseLineLnet/minecraft/block/entity/SignBlockEntity;parseLine(Lnet/minecraft/text/Text;)Lnet/minecraft/text/Text;intermediary method_50009Lnet/minecraft/class_2625;method_50009(Lnet/minecraft/class_2561;)Lnet/minecraft/class_2561;official aLdrs;a(Lwz;)Lwz;
-
tryChangeText
- Mappings:
Namespace Name Mixin selector named tryChangeTextLnet/minecraft/block/entity/SignBlockEntity;tryChangeText(Lnet/minecraft/entity/player/PlayerEntity;ZLjava/util/List;)Vintermediary method_49836Lnet/minecraft/class_2625;method_49836(Lnet/minecraft/class_1657;ZLjava/util/List;)Vofficial aLdrs;a(Lcmx;ZLjava/util/List;)V
-
changeText
- Mappings:
Namespace Name Mixin selector named changeTextLnet/minecraft/block/entity/SignBlockEntity;changeText(Ljava/util/function/UnaryOperator;Z)Zintermediary method_49841Lnet/minecraft/class_2625;method_49841(Ljava/util/function/UnaryOperator;Z)Zofficial aLdrs;a(Ljava/util/function/UnaryOperator;Z)Z
-
getTextWithMessages
private SignText getTextWithMessages(PlayerEntity player, List<FilteredMessage> messages, SignText text) - Mappings:
Namespace Name Mixin selector named getTextWithMessagesLnet/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_49835Lnet/minecraft/class_2625;method_49835(Lnet/minecraft/class_1657;Ljava/util/List;Lnet/minecraft/class_8242;)Lnet/minecraft/class_8242;official aLdrs;a(Lcmx;Ljava/util/List;Ldrt;)Ldrt;
-
setText
- Mappings:
Namespace Name Mixin selector named setTextLnet/minecraft/block/entity/SignBlockEntity;setText(Lnet/minecraft/block/entity/SignText;Z)Zintermediary method_49840Lnet/minecraft/class_2625;method_49840(Lnet/minecraft/class_8242;Z)Zofficial aLdrs;a(Ldrt;Z)Z
-
setBackText
- Mappings:
Namespace Name Mixin selector named setBackTextLnet/minecraft/block/entity/SignBlockEntity;setBackText(Lnet/minecraft/block/entity/SignText;)Zintermediary method_49839Lnet/minecraft/class_2625;method_49839(Lnet/minecraft/class_8242;)Zofficial bLdrs;b(Ldrt;)Z
-
setFrontText
- Mappings:
Namespace Name Mixin selector named setFrontTextLnet/minecraft/block/entity/SignBlockEntity;setFrontText(Lnet/minecraft/block/entity/SignText;)Zintermediary method_49846Lnet/minecraft/class_2625;method_49846(Lnet/minecraft/class_8242;)Zofficial cLdrs;c(Ldrt;)Z
-
canRunCommandClickEvent
- Mappings:
Namespace Name Mixin selector named canRunCommandClickEventLnet/minecraft/block/entity/SignBlockEntity;canRunCommandClickEvent(ZLnet/minecraft/entity/player/PlayerEntity;)Zintermediary method_50010Lnet/minecraft/class_2625;method_50010(ZLnet/minecraft/class_1657;)Zofficial aLdrs;a(ZLcmx;)Z
-
runCommandClickEvent
- Mappings:
Namespace Name Mixin selector named runCommandClickEventLnet/minecraft/block/entity/SignBlockEntity;runCommandClickEvent(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Z)Zintermediary method_50007Lnet/minecraft/class_2625;method_50007(Lnet/minecraft/class_1657;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Z)Zofficial aLdrs;a(Lcmx;Ldcw;Ljd;Z)Z
-
createCommandSource
private static ServerCommandSource createCommandSource(@Nullable @Nullable PlayerEntity player, World world, BlockPos pos) - Mappings:
Namespace Name Mixin selector named createCommandSourceLnet/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_50006Lnet/minecraft/class_2625;method_50006(Lnet/minecraft/class_1657;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)Lnet/minecraft/class_2168;official aLdrs;a(Lcmx;Ldcw;Ljd;)Let;
-
toUpdatePacket
Description copied from class:BlockEntityReturns the packet to send to nearby players when the block entity's observable state changes, ornullto not send the packet.If the data returned by
initial chunk datais suitable for updates, the following shortcut can be used to create an update packet:BlockEntityUpdateS2CPacket.create(this). The NBT will be passed toBlockEntity.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:
toUpdatePacketin classBlockEntity- Returns:
- the packet to send to nearby players when the block entity's observable
state changes, or
nullto not send the packet - See Also:
- Mappings:
Namespace Name Mixin selector named toUpdatePacketLnet/minecraft/block/entity/SignBlockEntity;toUpdatePacket()Lnet/minecraft/network/packet/s2c/play/BlockEntityUpdateS2CPacket;intermediary method_38249Lnet/minecraft/class_2625;method_38249()Lnet/minecraft/class_2622;official lLdrs;l()Lacb;
-
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
toUpdatePacket()and decides to use the defaultBlockEntityUpdateS2CPacket."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:
toInitialChunkDataNbtin classBlockEntity- Returns:
- the serialized state of this block entity that is observable by clients
- See Also:
- Mappings:
Namespace Name Mixin selector named toInitialChunkDataNbtLnet/minecraft/block/entity/BlockEntity;toInitialChunkDataNbt(Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)Lnet/minecraft/nbt/NbtCompound;intermediary method_16887Lnet/minecraft/class_2586;method_16887(Lnet/minecraft/class_7225$class_7874;)Lnet/minecraft/class_2487;official aLdqh;a(Ljo$a;)Lub;
-
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:
copyItemDataRequiresOperatorin classBlockEntity- 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 copyItemDataRequiresOperatorLnet/minecraft/block/entity/BlockEntity;copyItemDataRequiresOperator()Zintermediary method_11011Lnet/minecraft/class_2586;method_11011()Zofficial qLdqh;q()Z
-
setEditor
- Mappings:
Namespace Name Mixin selector named setEditorLnet/minecraft/block/entity/SignBlockEntity;setEditor(Ljava/util/UUID;)Vintermediary method_11306Lnet/minecraft/class_2625;method_11306(Ljava/util/UUID;)Vofficial aLdrs;a(Ljava/util/UUID;)V
-
getEditor
- Mappings:
Namespace Name Mixin selector named getEditorLnet/minecraft/block/entity/SignBlockEntity;getEditor()Ljava/util/UUID;intermediary method_11305Lnet/minecraft/class_2625;method_11305()Ljava/util/UUID;official uLdrs;u()Ljava/util/UUID;
-
updateListeners
private void updateListeners()- Mappings:
Namespace Name Mixin selector named updateListenersLnet/minecraft/block/entity/SignBlockEntity;updateListeners()Vintermediary method_34272Lnet/minecraft/class_2625;method_34272()Vofficial wLdrs;w()V
-
isWaxed
public boolean isWaxed()- Mappings:
Namespace Name Mixin selector named isWaxedLnet/minecraft/block/entity/SignBlockEntity;isWaxed()Zintermediary method_49855Lnet/minecraft/class_2625;method_49855()Zofficial vLdrs;v()Z
-
setWaxed
public boolean setWaxed(boolean waxed) - Mappings:
Namespace Name Mixin selector named setWaxedLnet/minecraft/block/entity/SignBlockEntity;setWaxed(Z)Zintermediary method_49849Lnet/minecraft/class_2625;method_49849(Z)Zofficial bLdrs;b(Z)Z
-
isPlayerTooFarToEdit
- Mappings:
Namespace Name Mixin selector named isPlayerTooFarToEditLnet/minecraft/block/entity/SignBlockEntity;isPlayerTooFarToEdit(Ljava/util/UUID;)Zintermediary method_49847Lnet/minecraft/class_2625;method_49847(Ljava/util/UUID;)Zofficial bLdrs;b(Ljava/util/UUID;)Z
-
tick
- Mappings:
Namespace Name Mixin selector named tickLnet/minecraft/block/entity/SignBlockEntity;tick(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/block/entity/SignBlockEntity;)Vintermediary method_49837Lnet/minecraft/class_2625;method_49837(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;Lnet/minecraft/class_2625;)Vofficial aLdrs;a(Ldcw;Ljd;Ldtc;Ldrs;)V
-
tryClearInvalidEditor
- Mappings:
Namespace Name Mixin selector named tryClearInvalidEditorLnet/minecraft/block/entity/SignBlockEntity;tryClearInvalidEditor(Lnet/minecraft/block/entity/SignBlockEntity;Lnet/minecraft/world/World;Ljava/util/UUID;)Vintermediary method_49838Lnet/minecraft/class_2625;method_49838(Lnet/minecraft/class_2625;Lnet/minecraft/class_1937;Ljava/util/UUID;)Vofficial aLdrs;a(Ldrs;Ldcw;Ljava/util/UUID;)V
-
getInteractionFailSound
- Mappings:
Namespace Name Mixin selector named getInteractionFailSoundLnet/minecraft/block/entity/SignBlockEntity;getInteractionFailSound()Lnet/minecraft/sound/SoundEvent;intermediary method_54303Lnet/minecraft/class_2625;method_54303()Lnet/minecraft/class_3414;official dLdrs;d()Lavo;
-