public class LazyBlock extends BaseBlock
InputExtent.getLazyBlock(Vector)
that takes the block's ID and metadata, but will defer loading of NBT
data until time of access.
NBT data is later loaded using a call to InputExtent.getBlock(Vector)
with a stored Extent
and location.
All mutators on this object will throw an
UnsupportedOperationException
.
Constructor and Description |
---|
LazyBlock(int type,
Extent extent,
Vector position)
Create a new lazy block.
|
LazyBlock(int type,
int data,
Extent extent,
Vector position)
Create a new lazy block.
|
Modifier and Type | Method and Description |
---|---|
CompoundTag |
getNbtData()
Get the object's NBT data (tile entity data).
|
void |
setData(int data)
Set the block's data value.
|
void |
setId(int id)
Set the block ID.
|
void |
setNbtData(CompoundTag nbtData)
Set the object's NBT data (tile entity data).
|
containsFuzzy, cycleData, equals, equalsFuzzy, flip, flip, getData, getId, getNbtId, getType, hashCode, hasNbtData, hasWildcardData, inIterable, internalSetData, internalSetId, isAir, rotate90, rotate90Reverse, setIdAndData, setType, toString
public LazyBlock(int type, Extent extent, Vector position)
type
- the block typeextent
- the extent to later load the full block data fromposition
- the position to later load the full block data frompublic void setId(int id)
BaseBlock
setId
in class BaseBlock
id
- block id (between 0 and BaseBlock.MAX_ID
).public void setData(int data)
BaseBlock
setData
in class BaseBlock
data
- block data value (between 0 and BaseBlock.MAX_DATA
).public CompoundTag getNbtData()
NbtValued
NbtValued.setNbtData(CompoundTag)
so that the instance knows of the changes. Making changes without
calling NbtValued.setNbtData(CompoundTag)
could have unintended
consequences.
NbtValued.hasNbtData()
must return true if and only if method does
not return null.
getNbtData
in interface NbtValued
getNbtData
in class BaseBlock
public void setNbtData(CompoundTag nbtData)
NbtValued
setNbtData
in interface NbtValued
setNbtData
in class BaseBlock
nbtData
- NBT data, or null if no data