Class LecternBlockEntity
java.lang.Object
org.cloudburstmc.server.blockentity.BaseBlockEntity
org.cloudburstmc.server.blockentity.LecternBlockEntity
- All Implemented Interfaces:
org.cloudburstmc.api.blockentity.BlockEntity,org.cloudburstmc.api.blockentity.Lectern
public class LecternBlockEntity
extends BaseBlockEntity
implements org.cloudburstmc.api.blockentity.Lectern
-
Field Summary
Fields inherited from class org.cloudburstmc.server.blockentity.BaseBlockEntity
closed, id, ID_ALLOCATOR, lastUpdate, movable, server, timing -
Constructor Summary
ConstructorsConstructorDescriptionLecternBlockEntity(org.cloudburstmc.api.blockentity.BlockEntityType<?> type, org.cloudburstmc.api.level.chunk.Chunk chunk, com.nukkitx.math.vector.Vector3i position) -
Method Summary
Modifier and TypeMethodDescriptionorg.cloudburstmc.api.item.ItemStackgetBook()intintgetPage()intintbooleanhasBook()protected voidinit()booleanbooleanisValid()voidloadAdditionalData(com.nukkitx.nbt.NbtMap tag)voidonBreak()voidsaveAdditionalData(com.nukkitx.nbt.NbtMapBuilder tag)voidsetBook(org.cloudburstmc.api.item.ItemStack item)voidsetLeftPage(int newLeftPage)voidsetPage(int page)voidsetRightPage(int newRightPage)Methods inherited from class org.cloudburstmc.server.blockentity.BaseBlockEntity
close, getBlock, getBlockState, getChunk, getChunkTag, getClientTag, getCustomName, getId, getItemTag, getLevel, getPosition, getServer, getServerTag, getTag, getType, hasCustomName, isClosed, isMovable, onUpdate, saveClientData, scheduleUpdate, setCustomName, setDirty, setMovable, spawnTo, spawnToAll, updateFromClient, updateNbtMapMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.cloudburstmc.api.blockentity.BlockEntity
close, getBlock, getBlockState, getCustomName, getLevel, getPosition, getType, hasCustomName, isClosed, isMovable, onUpdate, scheduleUpdate, setCustomName, setDirty, setMovable, spawnTo, spawnToAll
-
Constructor Details
-
LecternBlockEntity
public LecternBlockEntity(org.cloudburstmc.api.blockentity.BlockEntityType<?> type, org.cloudburstmc.api.level.chunk.Chunk chunk, com.nukkitx.math.vector.Vector3i position)
-
-
Method Details
-
isValid
public boolean isValid()- Specified by:
isValidin interfaceorg.cloudburstmc.api.blockentity.BlockEntity- Specified by:
isValidin classBaseBlockEntity
-
init
protected void init()- Overrides:
initin classBaseBlockEntity
-
loadAdditionalData
public void loadAdditionalData(com.nukkitx.nbt.NbtMap tag)- Overrides:
loadAdditionalDatain classBaseBlockEntity
-
saveAdditionalData
public void saveAdditionalData(com.nukkitx.nbt.NbtMapBuilder tag)- Overrides:
saveAdditionalDatain classBaseBlockEntity
-
onBreak
public void onBreak()- Specified by:
onBreakin interfaceorg.cloudburstmc.api.blockentity.BlockEntity- Overrides:
onBreakin classBaseBlockEntity
-
hasBook
public boolean hasBook()- Specified by:
hasBookin interfaceorg.cloudburstmc.api.blockentity.Lectern
-
getBook
@Nullable public org.cloudburstmc.api.item.ItemStack getBook()- Specified by:
getBookin interfaceorg.cloudburstmc.api.blockentity.Lectern
-
setBook
public void setBook(org.cloudburstmc.api.item.ItemStack item)- Specified by:
setBookin interfaceorg.cloudburstmc.api.blockentity.Lectern
-
getLeftPage
public int getLeftPage() -
setLeftPage
public void setLeftPage(int newLeftPage) -
getRightPage
public int getRightPage() -
setRightPage
public void setRightPage(int newRightPage) -
getPage
public int getPage()- Specified by:
getPagein interfaceorg.cloudburstmc.api.blockentity.Lectern
-
setPage
public void setPage(@Nonnegative int page)- Specified by:
setPagein interfaceorg.cloudburstmc.api.blockentity.Lectern
-
getTotalPages
public int getTotalPages()- Specified by:
getTotalPagesin interfaceorg.cloudburstmc.api.blockentity.Lectern
-
isSpawnable
public boolean isSpawnable()- Specified by:
isSpawnablein interfaceorg.cloudburstmc.api.blockentity.BlockEntity- Overrides:
isSpawnablein classBaseBlockEntity
-