Package net.minecraft.block.entity
Class LecternBlockEntity
java.lang.Object
net.minecraft.block.entity.BlockEntity
net.minecraft.block.entity.LecternBlockEntity
- All Implemented Interfaces:
NamedScreenHandlerFactory
,ScreenHandlerFactory
,Clearable
public class LecternBlockEntity extends BlockEntity implements Clearable, NamedScreenHandlerFactory
-
Field Summary
Fields Modifier and Type Field Description private ItemStack
book
private int
currentPage
private Inventory
inventory
private int
pageCount
private PropertyDelegate
propertyDelegate
Fields inherited from class net.minecraft.block.entity.BlockEntity
pos, removed, world
-
Constructor Summary
Constructors Constructor Description LecternBlockEntity(BlockPos blockPos, BlockState blockState)
-
Method Summary
Modifier and Type Method Description void
clear()
boolean
copyItemDataRequiresOperator()
ScreenHandler
createMenu(int syncId, PlayerInventory inv, PlayerEntity player)
void
fromTag(CompoundTag tag)
ItemStack
getBook()
private ServerCommandSource
getCommandSource(PlayerEntity player)
int
getComparatorOutput()
int
getCurrentPage()
Text
getDisplayName()
Returns the title of this screen handler; will be a part of the open screen packet sent to the client.boolean
hasBook()
private void
onBookRemoved()
private ItemStack
resolveBook(ItemStack book, PlayerEntity player)
void
setBook(ItemStack book)
void
setBook(ItemStack book, PlayerEntity player)
private void
setCurrentPage(int currentPage)
CompoundTag
toTag(CompoundTag tag)
Methods inherited from class net.minecraft.block.entity.BlockEntity
cancelRemoval, createFromTag, getCachedState, getPos, getSquaredRenderDistance, getType, getWorld, hasWorld, isRemoved, markDirty, markDirty, markRemoved, onSyncedBlockEvent, populateCrashReport, setCachedState, setWorld, toInitialChunkDataTag, toUpdatePacket
-
Field Details
-
inventory
-
propertyDelegate
-
book
-
currentPage
private int currentPage -
pageCount
private int pageCount
-
-
Constructor Details
-
LecternBlockEntity
-
-
Method Details
-
getBook
-
hasBook
public boolean hasBook() -
setBook
-
onBookRemoved
private void onBookRemoved() -
setBook
-
setCurrentPage
private void setCurrentPage(int currentPage) -
getCurrentPage
public int getCurrentPage() -
getComparatorOutput
public int getComparatorOutput() -
resolveBook
-
getCommandSource
-
copyItemDataRequiresOperator
public boolean copyItemDataRequiresOperator()- Overrides:
copyItemDataRequiresOperator
in classBlockEntity
-
fromTag
- Overrides:
fromTag
in classBlockEntity
-
toTag
- Overrides:
toTag
in classBlockEntity
-
clear
public void clear() -
createMenu
- Specified by:
createMenu
in interfaceScreenHandlerFactory
-
getDisplayName
Returns the title of this screen handler; will be a part of the open screen packet sent to the client.- Specified by:
getDisplayName
in interfaceNamedScreenHandlerFactory
-