Class SignBlockEntity
- Direct Known Subclasses:
HangingSignBlockEntity
- Mappings:
Namespace Name official dav
intermediary net/minecraft/class_2625
named net/minecraft/block/entity/SignBlockEntity
-
Field Summary
Modifier and TypeFieldDescriptionprivate SignText
private SignText
private static final Logger
private static final int
private static final int
private boolean
Fields inherited from class net.minecraft.block.entity.BlockEntity
pos, removed, world
-
Constructor Summary
ConstructorDescriptionSignBlockEntity
(BlockEntityType type, BlockPos pos, BlockState state) SignBlockEntity
(BlockPos pos, BlockState state) -
Method Summary
Modifier and TypeMethodDescriptionboolean
canRunCommandClickEvent
(boolean front, PlayerEntity player) boolean
changeText
(UnaryOperator<SignText> textChanger, boolean front) boolean
Returns whether the block item should require the player to have operator permissions to copy the block entity data on placement.private static ServerCommandSource
createCommandSource
(@Nullable PlayerEntity player, World world, BlockPos pos) protected SignText
int
getText
(boolean front) getTextFacing
(PlayerEntity player) int
private SignText
getTextWithMessages
(PlayerEntity player, List<FilteredMessage> messages, SignText text) boolean
isPlayerFacingFront
(PlayerEntity player) boolean
isPlayerTooFarToEdit
(UUID uuid) boolean
isWaxed()
private Text
private SignText
parseLines
(SignText signText) void
readNbt
(NbtCompound nbt) Reads data fromnbt
.boolean
runCommandClickEvent
(PlayerEntity player, World world, BlockPos pos, boolean front) private boolean
setBackText
(SignText backText) void
private boolean
setFrontText
(SignText frontText) boolean
boolean
setWaxed
(boolean waxed) static void
tick
(World world, BlockPos pos, BlockState state, SignBlockEntity blockEntity) 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, ornull
to not send the packet.void
tryChangeText
(PlayerEntity player, boolean front, List<FilteredMessage> messages) private void
tryClearInvalidEditor
(SignBlockEntity blockEntity, World world, UUID uuid) private void
protected void
writeNbt
(NbtCompound nbt) Writes data tonbt
.Methods inherited from class net.minecraft.block.entity.BlockEntity
cancelRemoval, createFromNbt, createNbt, createNbtWithId, createNbtWithIdentifyingData, getCachedState, getPos, getType, getWorld, hasWorld, isRemoved, markDirty, markDirty, markRemoved, onSyncedBlockEvent, populateCrashReport, posFromNbt, setCachedState, setStackNbt, setWorld, writeIdToNbt
-
Field Details
-
LOGGER
- Mappings:
Namespace Name Mixin selector official a
Ldav;a:Lorg/slf4j/Logger;
intermediary field_43294
Lnet/minecraft/class_2625;field_43294:Lorg/slf4j/Logger;
named LOGGER
Lnet/minecraft/block/entity/SignBlockEntity;LOGGER:Lorg/slf4j/Logger;
-
MAX_TEXT_WIDTH
private static final int MAX_TEXT_WIDTH- See Also:
- Mappings:
Namespace Name Mixin selector official b
Ldav;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
Ldav;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
-
editor
- Mappings:
Namespace Name Mixin selector official d
Ldav;d: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;
-
frontText
- Mappings:
Namespace Name Mixin selector official e
Ldav;e:Ldaw;
intermediary field_43295
Lnet/minecraft/class_2625;field_43295:Lnet/minecraft/class_8242;
named frontText
Lnet/minecraft/block/entity/SignBlockEntity;frontText:Lnet/minecraft/block/entity/SignText;
-
backText
- Mappings:
Namespace Name Mixin selector official f
Ldav;f:Ldaw;
intermediary field_43296
Lnet/minecraft/class_2625;field_43296:Lnet/minecraft/class_8242;
named backText
Lnet/minecraft/block/entity/SignBlockEntity;backText:Lnet/minecraft/block/entity/SignText;
-
waxed
private boolean waxed- Mappings:
Namespace Name Mixin selector official g
Ldav;g:Z
intermediary field_43297
Lnet/minecraft/class_2625;field_43297:Z
named waxed
Lnet/minecraft/block/entity/SignBlockEntity;waxed:Z
-
-
Constructor Details
-
SignBlockEntity
- Mappings:
Namespace Name Mixin selector official <init>
Ldav;<init>(Lgu;Ldcb;)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
- Mappings:
Namespace Name Mixin selector official <init>
Lczn;<init>(Lczp;Lgu;Ldcb;)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
-
createText
- Mappings:
Namespace Name Mixin selector official f
Ldav;f()Ldaw;
intermediary method_49852
Lnet/minecraft/class_2625;method_49852()Lnet/minecraft/class_8242;
named createText
Lnet/minecraft/block/entity/SignBlockEntity;createText()Lnet/minecraft/block/entity/SignText;
-
isPlayerFacingFront
- Mappings:
Namespace Name Mixin selector official a
Ldav;a(Lbyo;)Z
intermediary method_49834
Lnet/minecraft/class_2625;method_49834(Lnet/minecraft/class_1657;)Z
named isPlayerFacingFront
Lnet/minecraft/block/entity/SignBlockEntity;isPlayerFacingFront(Lnet/minecraft/entity/player/PlayerEntity;)Z
-
getTextFacing
- Mappings:
Namespace Name Mixin selector official b
Ldav;b(Lbyo;)Ldaw;
intermediary method_49844
Lnet/minecraft/class_2625;method_49844(Lnet/minecraft/class_1657;)Lnet/minecraft/class_8242;
named getTextFacing
Lnet/minecraft/block/entity/SignBlockEntity;getTextFacing(Lnet/minecraft/entity/player/PlayerEntity;)Lnet/minecraft/block/entity/SignText;
-
getText
- Mappings:
Namespace Name Mixin selector official a
Ldav;a(Z)Ldaw;
intermediary method_49843
Lnet/minecraft/class_2625;method_49843(Z)Lnet/minecraft/class_8242;
named getText
Lnet/minecraft/block/entity/SignBlockEntity;getText(Z)Lnet/minecraft/block/entity/SignText;
-
getFrontText
- Mappings:
Namespace Name Mixin selector official g
Ldav;g()Ldaw;
intermediary method_49853
Lnet/minecraft/class_2625;method_49853()Lnet/minecraft/class_8242;
named getFrontText
Lnet/minecraft/block/entity/SignBlockEntity;getFrontText()Lnet/minecraft/block/entity/SignText;
-
getBackText
- Mappings:
Namespace Name Mixin selector official i
Ldav;i()Ldaw;
intermediary method_49854
Lnet/minecraft/class_2625;method_49854()Lnet/minecraft/class_8242;
named getBackText
Lnet/minecraft/block/entity/SignBlockEntity;getBackText()Lnet/minecraft/block/entity/SignText;
-
getTextLineHeight
public int getTextLineHeight()- Mappings:
Namespace Name Mixin selector official c
Ldav;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
Ldav;d()I
intermediary method_45470
Lnet/minecraft/class_2625;method_45470()I
named getMaxTextWidth
Lnet/minecraft/block/entity/SignBlockEntity;getMaxTextWidth()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:
writeNbt
in classBlockEntity
- See Also:
- Mappings:
Namespace Name Mixin selector official b
Lczn;b(Lqr;)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
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.
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 classBlockEntity
- See Also:
- Mappings:
Namespace Name Mixin selector official a
Lczn;a(Lqr;)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
-
parseLines
- Mappings:
Namespace Name Mixin selector official a
Ldav;a(Ldaw;)Ldaw;
intermediary method_50008
Lnet/minecraft/class_2625;method_50008(Lnet/minecraft/class_8242;)Lnet/minecraft/class_8242;
named parseLines
Lnet/minecraft/block/entity/SignBlockEntity;parseLines(Lnet/minecraft/block/entity/SignText;)Lnet/minecraft/block/entity/SignText;
-
parseLine
- Mappings:
Namespace Name Mixin selector official a
Ldav;a(Lsw;)Lsw;
intermediary method_50009
Lnet/minecraft/class_2625;method_50009(Lnet/minecraft/class_2561;)Lnet/minecraft/class_2561;
named parseLine
Lnet/minecraft/block/entity/SignBlockEntity;parseLine(Lnet/minecraft/text/Text;)Lnet/minecraft/text/Text;
-
tryChangeText
- Mappings:
Namespace Name Mixin selector official a
Ldav;a(Lbyo;ZLjava/util/List;)V
intermediary method_49836
Lnet/minecraft/class_2625;method_49836(Lnet/minecraft/class_1657;ZLjava/util/List;)V
named tryChangeText
Lnet/minecraft/block/entity/SignBlockEntity;tryChangeText(Lnet/minecraft/entity/player/PlayerEntity;ZLjava/util/List;)V
-
changeText
- Mappings:
Namespace Name Mixin selector official a
Ldav;a(Ljava/util/function/UnaryOperator;Z)Z
intermediary method_49841
Lnet/minecraft/class_2625;method_49841(Ljava/util/function/UnaryOperator;Z)Z
named changeText
Lnet/minecraft/block/entity/SignBlockEntity;changeText(Ljava/util/function/UnaryOperator;Z)Z
-
getTextWithMessages
private SignText getTextWithMessages(PlayerEntity player, List<FilteredMessage> messages, SignText text) - Mappings:
Namespace Name Mixin selector official a
Ldav;a(Lbyo;Ljava/util/List;Ldaw;)Ldaw;
intermediary method_49835
Lnet/minecraft/class_2625;method_49835(Lnet/minecraft/class_1657;Ljava/util/List;Lnet/minecraft/class_8242;)Lnet/minecraft/class_8242;
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;
-
setText
- Mappings:
Namespace Name Mixin selector official a
Ldav;a(Ldaw;Z)Z
intermediary method_49840
Lnet/minecraft/class_2625;method_49840(Lnet/minecraft/class_8242;Z)Z
named setText
Lnet/minecraft/block/entity/SignBlockEntity;setText(Lnet/minecraft/block/entity/SignText;Z)Z
-
setBackText
- Mappings:
Namespace Name Mixin selector official b
Ldav;b(Ldaw;)Z
intermediary method_49839
Lnet/minecraft/class_2625;method_49839(Lnet/minecraft/class_8242;)Z
named setBackText
Lnet/minecraft/block/entity/SignBlockEntity;setBackText(Lnet/minecraft/block/entity/SignText;)Z
-
setFrontText
- Mappings:
Namespace Name Mixin selector official c
Ldav;c(Ldaw;)Z
intermediary method_49846
Lnet/minecraft/class_2625;method_49846(Lnet/minecraft/class_8242;)Z
named setFrontText
Lnet/minecraft/block/entity/SignBlockEntity;setFrontText(Lnet/minecraft/block/entity/SignText;)Z
-
canRunCommandClickEvent
- Mappings:
Namespace Name Mixin selector official a
Ldav;a(ZLbyo;)Z
intermediary method_50010
Lnet/minecraft/class_2625;method_50010(ZLnet/minecraft/class_1657;)Z
named canRunCommandClickEvent
Lnet/minecraft/block/entity/SignBlockEntity;canRunCommandClickEvent(ZLnet/minecraft/entity/player/PlayerEntity;)Z
-
runCommandClickEvent
- Mappings:
Namespace Name Mixin selector official a
Ldav;a(Lbyo;Lcmm;Lgu;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
named runCommandClickEvent
Lnet/minecraft/block/entity/SignBlockEntity;runCommandClickEvent(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Z)Z
-
createCommandSource
private static ServerCommandSource createCommandSource(@Nullable @Nullable PlayerEntity player, World world, BlockPos pos) - Mappings:
Namespace Name Mixin selector official a
Ldav;a(Lbyo;Lcmm;Lgu;)Lds;
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;
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;
-
toUpdatePacket
Description copied from class:BlockEntity
Returns the packet to send to nearby players when the block entity's observable state changes, ornull
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 toBlockEntity.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 classBlockEntity
- 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 j
Ldav;j()Luz;
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
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 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()
.- Overrides:
toInitialChunkDataNbt
in classBlockEntity
- Returns:
- the serialized state of this block entity that is observable by clients
- See Also:
- Mappings:
Namespace Name Mixin selector official ao_
Lczn;ao_()Lqr;
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 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 official t
Lczn;t()Z
intermediary method_11011
Lnet/minecraft/class_2586;method_11011()Z
named copyItemDataRequiresOperator
Lnet/minecraft/block/entity/BlockEntity;copyItemDataRequiresOperator()Z
-
setEditor
- Mappings:
Namespace Name Mixin selector official a
Ldav;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
- Mappings:
Namespace Name Mixin selector official v
Ldav;v()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;
-
updateListeners
private void updateListeners()- Mappings:
Namespace Name Mixin selector official x
Ldav;x()V
intermediary method_34272
Lnet/minecraft/class_2625;method_34272()V
named updateListeners
Lnet/minecraft/block/entity/SignBlockEntity;updateListeners()V
-
isWaxed
public boolean isWaxed()- Mappings:
Namespace Name Mixin selector official w
Ldav;w()Z
intermediary method_49855
Lnet/minecraft/class_2625;method_49855()Z
named isWaxed
Lnet/minecraft/block/entity/SignBlockEntity;isWaxed()Z
-
setWaxed
public boolean setWaxed(boolean waxed) - Mappings:
Namespace Name Mixin selector official b
Ldav;b(Z)Z
intermediary method_49849
Lnet/minecraft/class_2625;method_49849(Z)Z
named setWaxed
Lnet/minecraft/block/entity/SignBlockEntity;setWaxed(Z)Z
-
isPlayerTooFarToEdit
- Mappings:
Namespace Name Mixin selector official b
Ldav;b(Ljava/util/UUID;)Z
intermediary method_49847
Lnet/minecraft/class_2625;method_49847(Ljava/util/UUID;)Z
named isPlayerTooFarToEdit
Lnet/minecraft/block/entity/SignBlockEntity;isPlayerTooFarToEdit(Ljava/util/UUID;)Z
-
tick
- Mappings:
Namespace Name Mixin selector official a
Ldav;a(Lcmm;Lgu;Ldcb;Ldav;)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
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
-
tryClearInvalidEditor
- Mappings:
Namespace Name Mixin selector official a
Ldav;a(Ldav;Lcmm;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
named tryClearInvalidEditor
Lnet/minecraft/block/entity/SignBlockEntity;tryClearInvalidEditor(Lnet/minecraft/block/entity/SignBlockEntity;Lnet/minecraft/world/World;Ljava/util/UUID;)V
-