Class LecternBlockEntity
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.LecternBlockEntity
- All Implemented Interfaces:
DebugValueSource,Clearable,MenuConstructor,MenuProvider,IAttachmentHolder,IBlockEntityExtension,IMenuProviderExtension
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.block.entity.BlockEntity
BlockEntity.BlockEntityPathElementNested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
AttachmentHolder.AsFieldNested classes/interfaces inherited from interface net.minecraft.util.debug.DebugValueSource
DebugValueSource.Registration, DebugValueSource.ValueGetter<T> -
Field Summary
FieldsModifier and TypeFieldDescription(package private) ItemStackprivate final Containerstatic final intprivate final ContainerDatastatic final intstatic final int(package private) intprivate intstatic final intFields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPositionFields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprivate CommandSourceStackcreateCommandSourceStack(Player pPlayer, ServerLevel pLevel) createMenu(int p_59562_, Inventory p_59563_, Player p_59564_) getBook()intgetPage()private static intgetPageCount(ItemStack pStack) intbooleanhasBook()protected voidloadAdditional(ValueInput p_422392_) (package private) voidvoidpreRemoveSideEffects(BlockPos p_393826_, BlockState p_393542_) private ItemStackresolveBook(ItemStack pStack, Player pPlayer) Resolves the contents of the passed ItemStack, if it is a bookprotected voidsaveAdditional(ValueOutput p_421844_) voidSets the ItemStack in this lectern.voidSets the ItemStack in this lectern.(package private) voidsetPage(int pPage) Methods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, applyComponents, applyComponentsFromItemStack, applyImplicitComponents, clearRemoved, collectComponents, collectImplicitComponents, components, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getNameForReporting, getPersistentData, getPosFromTag, getType, getUpdatePacket, getUpdateTag, hasLevel, isRemoved, isValidBlockState, loadCustomOnly, loadStatic, loadWithComponents, parseCustomNameSafe, problemPath, registerDebugValues, removeComponentsFromTag, removeData, saveCustomOnly, saveCustomOnly, saveWithFullMetadata, saveWithFullMetadata, saveWithId, saveWithoutMetadata, saveWithoutMetadata, setBlockState, setChanged, setChanged, setComponents, setData, setLevel, setRemoved, syncData, triggerEventMethods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingDataOrNull, hasAttachments, hasData, serializeAttachmentsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setData, syncDataMethods inherited from interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension
getModelData, handleUpdateTag, hasCustomOutlineRendering, invalidateCapabilities, onChunkUnloaded, onDataPacket, onLoad, requestModelDataUpdateMethods inherited from interface net.neoforged.neoforge.common.extensions.IMenuProviderExtension
shouldTriggerClientSideContainerClosingOnOpen, writeClientSideData
-
Field Details
-
DATA_PAGE
public static final int DATA_PAGE- See Also:
-
NUM_DATA
public static final int NUM_DATA- See Also:
-
SLOT_BOOK
public static final int SLOT_BOOK- See Also:
-
NUM_SLOTS
public static final int NUM_SLOTS- See Also:
-
bookAccess
-
dataAccess
-
book
ItemStack book -
page
int page -
pageCount
private int pageCount
-
-
Constructor Details
-
LecternBlockEntity
-
-
Method Details
-
getBook
-
hasBook
public boolean hasBook() -
setBook
Sets the ItemStack in this lectern. Note that this does not update the block state, useLecternBlock.tryPlaceBook(net.minecraft.world.entity.LivingEntity, net.minecraft.world.level.Level, net.minecraft.core.BlockPos, net.minecraft.world.level.block.state.BlockState, net.minecraft.world.item.ItemStack)for that. -
onBookItemRemove
void onBookItemRemove() -
setBook
Sets the ItemStack in this lectern. Note that this does not update the block state, useLecternBlock.tryPlaceBook(net.minecraft.world.entity.LivingEntity, net.minecraft.world.level.Level, net.minecraft.core.BlockPos, net.minecraft.world.level.block.state.BlockState, net.minecraft.world.item.ItemStack)for that.- Parameters:
pPlayer- the player used for resolving the components within the book
-
setPage
void setPage(int pPage) -
getPage
public int getPage() -
getRedstoneSignal
public int getRedstoneSignal() -
resolveBook
Resolves the contents of the passed ItemStack, if it is a book -
createCommandSourceStack
-
loadAdditional
- Overrides:
loadAdditionalin classBlockEntity
-
saveAdditional
- Overrides:
saveAdditionalin classBlockEntity
-
clearContent
public void clearContent()- Specified by:
clearContentin interfaceClearable
-
preRemoveSideEffects
- Overrides:
preRemoveSideEffectsin classBlockEntity
-
createMenu
- Specified by:
createMenuin interfaceMenuConstructor
-
getDisplayName
- Specified by:
getDisplayNamein interfaceMenuProvider
-
getPageCount
-