public class LecternBlockEntity extends BlockEntity implements Clearable, NamedScreenHandlerFactory
Modifier and Type | Field and Description |
---|---|
private ItemStack |
book |
private int |
currentPage |
private Inventory |
inventory |
private int |
pageCount |
private PropertyDelegate |
propertyDelegate |
pos, removed, world
Constructor and Description |
---|
LecternBlockEntity() |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
copyItemDataRequiresOperator() |
ScreenHandler |
createMenu(int syncId,
PlayerInventory inv,
PlayerEntity player) |
void |
fromTag(BlockState state,
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) |
applyMirror, applyRotation, cancelRemoval, createFromTag, getCachedState, getPos, getSquaredRenderDistance, getType, getWorld, hasWorld, isRemoved, markDirty, markInvalid, markRemoved, onSyncedBlockEvent, populateCrashReport, resetBlock, setLocation, setPos, toInitialChunkDataTag, toUpdatePacket
private final Inventory inventory
private final PropertyDelegate propertyDelegate
private ItemStack book
private int currentPage
private int pageCount
public ItemStack getBook()
public boolean hasBook()
public void setBook(ItemStack book)
private void onBookRemoved()
public void setBook(ItemStack book, @Nullable PlayerEntity player)
private void setCurrentPage(int currentPage)
public int getCurrentPage()
public int getComparatorOutput()
private ItemStack resolveBook(ItemStack book, @Nullable PlayerEntity player)
private ServerCommandSource getCommandSource(@Nullable PlayerEntity player)
public boolean copyItemDataRequiresOperator()
copyItemDataRequiresOperator
in class BlockEntity
public void fromTag(BlockState state, CompoundTag tag)
fromTag
in class BlockEntity
public CompoundTag toTag(CompoundTag tag)
toTag
in class BlockEntity
public ScreenHandler createMenu(int syncId, PlayerInventory inv, PlayerEntity player)
createMenu
in interface ScreenHandlerFactory
public Text getDisplayName()
getDisplayName
in interface NamedScreenHandlerFactory