Class SignBlockEntity
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.SignBlockEntity
- All Implemented Interfaces:
TypedInstance<BlockEntityType<?>>, DebugValueSource, IAttachmentHolder, IBlockEntityExtension
- Direct Known Subclasses:
HangingSignBlockEntity
-
Nested Class Summary
Nested classes/interfaces inherited from class AttachmentHolder
AttachmentHolder.AsFieldNested classes/interfaces inherited from interface DebugValueSource
DebugValueSource.Registration, DebugValueSource.ValueGetter<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate SignTextprivate static final booleanprivate SignTextprivate booleanprivate static final org.slf4j.Loggerprivate static final intprivate @Nullable UUIDprivate static final intFields inherited from class BlockEntity
level, remove, worldPositionFields inherited from class AttachmentHolder
ATTACHMENTS_NBT_KEY -
Constructor Summary
ConstructorsConstructorDescriptionSignBlockEntity(BlockPos worldPosition, BlockState blockState) SignBlockEntity(BlockEntityType<? extends SignBlockEntity> type, BlockPos worldPosition, BlockState blockState) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanExecuteClickCommands(boolean isFrontText, Player player) private voidclearInvalidPlayerWhoMayEdit(SignBlockEntity signBlockEntity, Level level, UUID playerWhoMayEdit) private static CommandSourceStackcreateCommandSourceStack(@Nullable Player player, ServerLevel level, BlockPos pos) protected SignTextbooleanexecuteClickCommandsIfPresent(ServerLevel level, Player player, BlockPos pos, boolean isFrontText) int@Nullable UUIDgetText(boolean isFrontText) intgetUpdateTag(HolderLookup.Provider registries) booleanisFacingFrontText(Player player) booleanisWaxed()protected voidloadAdditional(ValueInput input) private Componentprivate SignTextprivate voidbooleanplayerIsTooFarAwayToEdit(UUID player) protected voidsaveAdditional(ValueOutput output) voidsetAllowedPlayerEditor(@Nullable UUID playerUUID) private booleansetBackText(SignText text) private booleansetFrontText(SignText text) private SignTextsetMessages(Player player, List<FilteredText> lines, SignText text) booleanbooleansetWaxed(boolean isWaxed) static voidtick(Level level, BlockPos blockPos, BlockState blockState, SignBlockEntity signBlockEntity) voidupdateSignText(Player player, boolean frontText, List<FilteredText> lines) booleanupdateText(UnaryOperator<SignText> function, boolean isFrontText) Methods inherited from class BlockEntity
addEntityType, applyComponents, applyComponentsFromItemStack, applyImplicitComponents, clearRemoved, collectComponents, collectImplicitComponents, components, fillCrashReportCategory, getAndClearAttachmentTypesToSync, getBlockPos, getBlockState, getLevel, getNameForReporting, getPersistentData, getPosFromTag, getType, hasLevel, isRemoved, isValidBlockState, loadCustomOnly, loadStatic, loadWithComponents, parseCustomNameSafe, preRemoveSideEffects, problemPath, registerDebugValues, removeComponentsFromTag, removeData, saveCustomOnly, saveCustomOnly, saveWithFullMetadata, saveWithFullMetadata, saveWithId, saveWithoutMetadata, saveWithoutMetadata, setBlockState, setChanged, setChanged, setComponents, setData, setLevel, setRemoved, syncData, triggerEvent, typeHolderMethods inherited from class AttachmentHolder
deserializeAttachments, getData, getExistingDataOrNull, hasAttachments, hasData, serializeAttachmentsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IAttachmentHolder
getData, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setData, syncDataMethods inherited from interface IBlockEntityExtension
getModelData, handleUpdateTag, hasCustomOutlineRendering, invalidateCapabilities, onChunkUnloaded, onDataPacket, onLoad, requestModelDataUpdate
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
MAX_TEXT_LINE_WIDTH
private static final int MAX_TEXT_LINE_WIDTH- See Also:
-
TEXT_LINE_HEIGHT
private static final int TEXT_LINE_HEIGHT- See Also:
-
DEFAULT_IS_WAXED
private static final boolean DEFAULT_IS_WAXED- See Also:
-
playerWhoMayEdit
-
frontText
-
backText
-
isWaxed
private boolean isWaxed
-
-
Constructor Details
-
SignBlockEntity
-
SignBlockEntity
public SignBlockEntity(BlockEntityType<? extends SignBlockEntity> type, BlockPos worldPosition, BlockState blockState)
-
-
Method Details
-
createDefaultSignText
-
isFacingFrontText
-
getText
-
getFrontText
-
getBackText
-
getTextLineHeight
public int getTextLineHeight() -
getMaxTextLineWidth
public int getMaxTextLineWidth() -
saveAdditional
- Overrides:
saveAdditionalin classBlockEntity
-
loadAdditional
- Overrides:
loadAdditionalin classBlockEntity
-
loadLines
-
loadLine
-
updateSignText
-
updateText
-
setMessages
-
setText
-
setBackText
-
setFrontText
-
canExecuteClickCommands
-
executeClickCommandsIfPresent
public boolean executeClickCommandsIfPresent(ServerLevel level, Player player, BlockPos pos, boolean isFrontText) -
createCommandSourceStack
private static CommandSourceStack createCommandSourceStack(@Nullable Player player, ServerLevel level, BlockPos pos) -
getUpdatePacket
- Overrides:
getUpdatePacketin classBlockEntity
-
getUpdateTag
- Overrides:
getUpdateTagin classBlockEntity
-
setAllowedPlayerEditor
-
getPlayerWhoMayEdit
-
markUpdated
private void markUpdated() -
isWaxed
public boolean isWaxed() -
setWaxed
public boolean setWaxed(boolean isWaxed) -
playerIsTooFarAwayToEdit
-
tick
public static void tick(Level level, BlockPos blockPos, BlockState blockState, SignBlockEntity signBlockEntity) -
clearInvalidPlayerWhoMayEdit
private void clearInvalidPlayerWhoMayEdit(SignBlockEntity signBlockEntity, Level level, UUID playerWhoMayEdit) -
getSignInteractionFailedSoundEvent
-