public abstract class BaseBlockEntity extends Object implements org.cloudburstmc.api.blockentity.BlockEntity
| Modifier and Type | Field and Description |
|---|---|
boolean |
closed |
long |
id |
static AtomicLong |
ID_ALLOCATOR |
protected long |
lastUpdate |
boolean |
movable |
protected CloudServer |
server |
protected Timing |
timing |
| Constructor and Description |
|---|
BaseBlockEntity(org.cloudburstmc.api.blockentity.BlockEntityType<?> type,
org.cloudburstmc.api.level.chunk.Chunk chunk,
com.nukkitx.math.vector.Vector3i position) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
org.cloudburstmc.api.block.Block |
getBlock() |
org.cloudburstmc.api.block.BlockState |
getBlockState() |
CloudChunk |
getChunk() |
com.nukkitx.nbt.NbtMap |
getChunkTag() |
com.nukkitx.nbt.NbtMap |
getClientTag() |
String |
getCustomName()
Gets the name of this object.
|
long |
getId() |
com.nukkitx.nbt.NbtMap |
getItemTag() |
CloudLevel |
getLevel() |
com.nukkitx.math.vector.Vector3i |
getPosition() |
CloudServer |
getServer() |
com.nukkitx.nbt.NbtMap |
getServerTag() |
com.nukkitx.nbt.NbtMap |
getTag() |
org.cloudburstmc.api.blockentity.BlockEntityType<?> |
getType() |
boolean |
hasCustomName()
Whether this object has a name.
|
protected void |
init() |
boolean |
isClosed() |
boolean |
isMovable() |
boolean |
isSpawnable() |
abstract boolean |
isValid() |
void |
loadAdditionalData(com.nukkitx.nbt.NbtMap tag) |
void |
onBreak() |
boolean |
onUpdate() |
void |
saveAdditionalData(com.nukkitx.nbt.NbtMapBuilder tag) |
protected void |
saveClientData(com.nukkitx.nbt.NbtMapBuilder tag)
NBT data that is specifically sent to the client
|
void |
scheduleUpdate() |
void |
setCustomName(String customName)
Changes the name of this object, or names it.
|
void |
setDirty() |
void |
setMovable(boolean moveble) |
void |
spawnTo(org.cloudburstmc.api.player.Player player) |
void |
spawnToAll() |
boolean |
updateFromClient(com.nukkitx.nbt.NbtMap tag,
CloudPlayer player) |
protected boolean |
updateNbtMap(com.nukkitx.nbt.NbtMap nbt,
CloudPlayer player)
Called when a player updates a block entity's NBT data
for example when writing on a sign.
|
public static AtomicLong ID_ALLOCATOR
public final long id
public boolean movable
public boolean closed
protected long lastUpdate
protected CloudServer server
protected Timing timing
public BaseBlockEntity(org.cloudburstmc.api.blockentity.BlockEntityType<?> type,
org.cloudburstmc.api.level.chunk.Chunk chunk,
com.nukkitx.math.vector.Vector3i position)
public com.nukkitx.nbt.NbtMap getTag()
public CloudServer getServer()
public org.cloudburstmc.api.blockentity.BlockEntityType<?> getType()
getType in interface org.cloudburstmc.api.blockentity.BlockEntityprotected void init()
public long getId()
public void loadAdditionalData(com.nukkitx.nbt.NbtMap tag)
public void saveAdditionalData(com.nukkitx.nbt.NbtMapBuilder tag)
protected void saveClientData(com.nukkitx.nbt.NbtMapBuilder tag)
tag - tag to write data topublic final com.nukkitx.nbt.NbtMap getItemTag()
public final com.nukkitx.nbt.NbtMap getServerTag()
public final com.nukkitx.nbt.NbtMap getClientTag()
public final com.nukkitx.nbt.NbtMap getChunkTag()
public abstract boolean isValid()
isValid in interface org.cloudburstmc.api.blockentity.BlockEntitypublic boolean onUpdate()
onUpdate in interface org.cloudburstmc.api.blockentity.BlockEntitypublic final void scheduleUpdate()
scheduleUpdate in interface org.cloudburstmc.api.blockentity.BlockEntitypublic void close()
close in interface org.cloudburstmc.api.blockentity.BlockEntitypublic boolean isClosed()
isClosed in interface org.cloudburstmc.api.blockentity.BlockEntitypublic void onBreak()
onBreak in interface org.cloudburstmc.api.blockentity.BlockEntitypublic void setDirty()
setDirty in interface org.cloudburstmc.api.blockentity.BlockEntitypublic boolean isMovable()
isMovable in interface org.cloudburstmc.api.blockentity.BlockEntitypublic void setMovable(boolean moveble)
setMovable in interface org.cloudburstmc.api.blockentity.BlockEntity@Nullable public final String getCustomName()
getCustomName in interface org.cloudburstmc.api.blockentity.BlockEntitypublic final void setCustomName(@Nullable String customName)
setCustomName in interface org.cloudburstmc.api.blockentity.BlockEntitycustomName - The new name of this object.public final boolean hasCustomName()
hasCustomName in interface org.cloudburstmc.api.blockentity.BlockEntitytrue for this object has a name.public void spawnTo(org.cloudburstmc.api.player.Player player)
spawnTo in interface org.cloudburstmc.api.blockentity.BlockEntitypublic void spawnToAll()
spawnToAll in interface org.cloudburstmc.api.blockentity.BlockEntitypublic final boolean updateFromClient(com.nukkitx.nbt.NbtMap tag,
CloudPlayer player)
protected boolean updateNbtMap(com.nukkitx.nbt.NbtMap nbt,
CloudPlayer player)
nbt - tagplayer - playerpublic boolean isSpawnable()
isSpawnable in interface org.cloudburstmc.api.blockentity.BlockEntitypublic com.nukkitx.math.vector.Vector3i getPosition()
getPosition in interface org.cloudburstmc.api.blockentity.BlockEntitypublic CloudLevel getLevel()
getLevel in interface org.cloudburstmc.api.blockentity.BlockEntitypublic CloudChunk getChunk()
public org.cloudburstmc.api.block.Block getBlock()
getBlock in interface org.cloudburstmc.api.blockentity.BlockEntitypublic org.cloudburstmc.api.block.BlockState getBlockState()
getBlockState in interface org.cloudburstmc.api.blockentity.BlockEntityCopyright © 2021. All rights reserved.