public class TridentBlock extends AbstractBlockMetaOwner<Block> implements Block
Modifier and Type | Field and Description |
---|---|
protected byte |
data
The block metadata
|
protected Substance |
material
The type for this block
|
Constructor and Description |
---|
TridentBlock(Position location)
Constructs the wrapper representing the block
|
TridentBlock(Position location,
Substance substance,
byte meta) |
Modifier and Type | Method and Description |
---|---|
<M extends BlockMeta<Block>> |
applyMeta(boolean replace,
M... meta)
Commits the changes from the meta value to the block
|
void |
clearMeta()
Removes all meta values and sets the block meta to
(byte) 0 |
protected MetaCollection<Block> |
collect()
Create the metadata storage collection
|
byte |
meta()
Gets the tile data
|
Position |
position()
Returns the Location of the Block
|
Block |
relativeBlock(Vector vector)
Returns a block immediately to the direction specified
|
void |
setMeta(byte data)
Sets the tile data
|
void |
setSubstance(Substance substance)
Sets the substance the tile is made of
|
void |
setSubstanceAndMeta(Substance substance,
byte data)
Sets the substance the tile is made of and its tile data
|
Substance |
substance()
Gets the substance the tile is made of
|
applyMeta, newMetaIfNull, obtainMeta, ownedMeta
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applyMeta, newMetaIfNull, obtainMeta, ownedMeta
protected byte data
@InternalUseOnly public TridentBlock(Position location)
location
- Location of the Blockpublic TridentBlock(Position location, Substance substance, byte meta)
public Substance substance()
Block
public void setSubstance(Substance substance)
Block
setSubstance
in interface Block
substance
- the substance the tile should be set topublic Position position()
Block
public Block relativeBlock(Vector vector)
Block
relativeBlock
in interface Block
vector
- the direction to look for the block adjacent to the currentpublic void setSubstanceAndMeta(Substance substance, byte data)
Block
setSubstanceAndMeta
in interface Block
substance
- the substance the tile should be set todata
- the data the tile should be set toprotected MetaCollection<Block> collect()
AbstractBlockMetaOwner
collect
in class AbstractBlockMetaOwner<Block>
public void clearMeta()
MetaOwner
(byte) 0
public <M extends BlockMeta<Block>> boolean applyMeta(boolean replace, M... meta)
MetaOwner
applyMeta
in interface MetaOwner<BlockMeta<Block>>
applyMeta
in class AbstractBlockMetaOwner<Block>
M
- the meta typereplace
- true
to apply meta anyways if the data mapping already existsmeta
- the metadatatrue
if the all of the meta changes took effectCopyright © 2016. All rights reserved.