public abstract class BlockEntity extends Object
Modifier and Type | Field and Description |
---|---|
private BlockState |
cachedState |
private boolean |
invalid |
private static Logger |
LOGGER |
protected BlockPos |
pos |
protected boolean |
removed |
private BlockEntityType<?> |
type |
protected World |
world |
Constructor and Description |
---|
BlockEntity(BlockEntityType<?> type) |
Modifier and Type | Method and Description |
---|---|
void |
applyMirror(BlockMirror mirror) |
void |
applyRotation(BlockRotation rotation) |
void |
cancelRemoval() |
boolean |
copyItemDataRequiresOperator() |
static BlockEntity |
createFromTag(BlockState state,
CompoundTag tag) |
void |
fromTag(BlockState state,
CompoundTag tag) |
BlockState |
getCachedState() |
BlockPos |
getPos() |
double |
getSquaredRenderDistance() |
BlockEntityType<?> |
getType() |
World |
getWorld() |
boolean |
hasWorld() |
boolean |
isRemoved() |
void |
markDirty() |
void |
markInvalid() |
void |
markRemoved() |
boolean |
onSyncedBlockEvent(int type,
int data) |
void |
populateCrashReport(CrashReportSection crashReportSection) |
void |
resetBlock() |
void |
setLocation(World world,
BlockPos pos) |
void |
setPos(BlockPos pos) |
CompoundTag |
toInitialChunkDataTag() |
CompoundTag |
toTag(CompoundTag tag) |
BlockEntityUpdateS2CPacket |
toUpdatePacket() |
private CompoundTag |
writeIdentifyingData(CompoundTag tag) |
private static final Logger LOGGER
private final BlockEntityType<?> type
protected BlockPos pos
protected boolean removed
@Nullable private BlockState cachedState
private boolean invalid
public BlockEntity(BlockEntityType<?> type)
public boolean hasWorld()
public void fromTag(BlockState state, CompoundTag tag)
public CompoundTag toTag(CompoundTag tag)
private CompoundTag writeIdentifyingData(CompoundTag tag)
@Nullable public static BlockEntity createFromTag(BlockState state, CompoundTag tag)
public void markDirty()
@Environment(value=CLIENT) public double getSquaredRenderDistance()
public BlockPos getPos()
public BlockState getCachedState()
@Nullable public BlockEntityUpdateS2CPacket toUpdatePacket()
public CompoundTag toInitialChunkDataTag()
public boolean isRemoved()
public void markRemoved()
public void cancelRemoval()
public boolean onSyncedBlockEvent(int type, int data)
public void resetBlock()
public void populateCrashReport(CrashReportSection crashReportSection)
public void setPos(BlockPos pos)
public boolean copyItemDataRequiresOperator()
public void applyRotation(BlockRotation rotation)
public void applyMirror(BlockMirror mirror)
public BlockEntityType<?> getType()
public void markInvalid()