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, TypedInstanceExtension<BlockEntityType<?>>, IWithData<BlockEntityType<?>>
- 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 booleanprivate SignTextprivate static final Componentprivate static final booleanprivate static final booleanprivate SignTextprivate booleanprivate static final org.slf4j.Loggerprivate static final intprivate 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 TypeMethodDescriptionprotected voidapplyImplicitComponents(DataComponentGetter components) booleancanExecuteClickCommands(SignTextSlot slot, Player player) private voidclearInvalidPlayerWhoMayEdit(SignBlockEntity signBlockEntity, Level level, UUID playerWhoMayEdit) protected voidcollectImplicitComponents(DataComponentMap.Builder components) private static CommandSourceStackcreateCommandSourceStack(@Nullable Player player, ServerLevel level, BlockPos pos) booleanexecuteClickCommandsIfPresent(ServerLevel level, Player player, BlockPos pos, SignTextSlot slot) intgetSlotPlayerIsFacing(Player player) getText(SignTextSlot slot) intgetUpdateTag(HolderLookup.Provider registries) booleanisWaxed()protected voidloadAdditional(ValueInput input) private voidbooleanplayerIsTooFarAwayToEdit(UUID player) voidremoveComponentsFromTag(ValueOutput output) private ComponentresolveLine(Component component) private SignTextresolveLines(SignText data) protected voidsaveAdditional(ValueOutput output) voidsetAllowedPlayerEditor(@Nullable UUID playerUUID) voidsetText(SignText text, SignTextSlot slot) booleansetWaxed(boolean isWaxed) static voidtick(Level level, BlockPos blockPos, BlockState blockState, SignBlockEntity signBlockEntity) private static SignTextupdateMessages(List<FilteredText> newLines, SignText originalText, boolean shouldFilter) voidupdateSignText(Player player, SignTextSlot slot, List<FilteredText> lines) booleanupdateText(UnaryOperator<SignText> function, SignTextSlot slot) Methods inherited from class BlockEntity
addEntityType, applyComponents, applyComponentsFromItemStack, clearRemoved, collectComponents, components, fillCrashReportCategory, getAndClearAttachmentTypesToSync, getBlockPos, getBlockState, getLevel, getNameForReporting, getPersistentData, getPosFromTag, getType, hasLevel, isRemoved, isValidBlockState, loadCustomOnly, loadStatic, loadWithComponents, parseCustomNameSafe, preRemoveSideEffects, problemPath, registerDebugValues, 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
applyStructureRotation, getModelData, handleUpdateTag, invalidateCapabilities, onChunkUnloaded, onDataPacket, onLoad, requestModelDataUpdateMethods inherited from interface TypedInstanceExtension
getData
-
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:
-
DEFAULT_ALLOW_OP_FEATURES
private static final boolean DEFAULT_ALLOW_OP_FEATURES- See Also:
-
CLICK_ACTIONS_DISABLED
-
playerWhoMayEdit
-
frontText
-
backText
-
isWaxed
private boolean isWaxed -
allowOpFeatures
private boolean allowOpFeatures
-
-
Constructor Details
-
SignBlockEntity
-
SignBlockEntity
public SignBlockEntity(BlockEntityType<? extends SignBlockEntity> type, BlockPos worldPosition, BlockState blockState)
-
-
Method Details
-
getSlotPlayerIsFacing
-
getText
-
getTextLineHeight
public int getTextLineHeight() -
getMaxTextLineWidth
public int getMaxTextLineWidth() -
saveAdditional
- Overrides:
saveAdditionalin classBlockEntity
-
loadAdditional
- Overrides:
loadAdditionalin classBlockEntity
-
resolveLines
-
resolveLine
-
updateSignText
-
updateText
-
updateMessages
private static SignText updateMessages(List<FilteredText> newLines, SignText originalText, boolean shouldFilter) -
setText
-
canExecuteClickCommands
-
executeClickCommandsIfPresent
public boolean executeClickCommandsIfPresent(ServerLevel level, Player player, BlockPos pos, SignTextSlot slot) -
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
-
applyImplicitComponents
- Overrides:
applyImplicitComponentsin classBlockEntity
-
collectImplicitComponents
- Overrides:
collectImplicitComponentsin classBlockEntity
-
removeComponentsFromTag
- Overrides:
removeComponentsFromTagin classBlockEntity
-