public abstract class BlockEntity extends Object
Modifier and Type | Field and Description |
---|---|
protected GlowBlock |
block
Get the block this BlockEntity is associated with.
|
Constructor and Description |
---|
BlockEntity(GlowBlock block)
Create a new BlockEntity at the given location.
|
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Destroy this BlockEntity.
|
GlowBlock |
getBlock()
Get the block this BlockEntity is associated with.
|
GlowBlockState |
getState()
Create a new BlockState which will correspond to this block entity.
|
void |
loadNbt(CompoundTag tag)
Read this BlockEntity's data from the saved tag.
|
void |
pulse()
Generic pulse for this block entity.
|
void |
saveNbt(CompoundTag tag)
Save this BlockEntity's data to NBT.
|
protected void |
setSaveId(@NonNls String saveId)
Set the text ID this block entity is saved to disk with.
|
void |
update(GlowPlayer player)
Update this BlockEntity's visible state to the given player.
|
void |
updateInRange()
Update this BlockEntity's visible state to all players in range.
|
protected final GlowBlock block
public BlockEntity(GlowBlock block)
block
- The block the BlockEntity is attached to.public final void updateInRange()
protected final void setSaveId(@NonNls @NonNls String saveId)
saveId
- The ID.public void loadNbt(CompoundTag tag)
tag
- The tag to load from.public void saveNbt(CompoundTag tag)
tag
- The tag to save to.public GlowBlockState getState()
public void destroy()
public void update(GlowPlayer player)
player
- The player to update.public void pulse()
public GlowBlock getBlock()
Copyright © 2021. All rights reserved.