@ThreadSafe public abstract class AbstractBlockMetaOwner<T extends MetaOwner> extends Object implements BlockMetaOwner<T>
Constructor and Description |
---|
AbstractBlockMetaOwner() |
Modifier and Type | Method and Description |
---|---|
<M extends BlockMeta<T>> |
applyMeta(boolean replace,
M... meta)
Commits the changes from the meta value to the block
|
<M extends BlockMeta<T>> |
applyMeta(M... meta)
Applies the specified metas to the owner, replacing the previous value if present
|
void |
clearMeta()
Removes all meta values and sets the block meta to
(byte) 0 |
protected abstract MetaCollection<T> |
collect()
Create the metadata storage collection
|
<M extends BlockMeta<T>> |
newMetaIfNull(Class<M> cls)
Creates a new metadata value for the type specified if this block supports it, and it is not already
created in the block
|
<M extends BlockMeta<T>> |
obtainMeta(Class<M> cls)
Obtains the meta tag from the class type
|
<M extends MetaOwner> |
ownedMeta()
Gets all of the metadata values currently owned by this meta owner
|
public AbstractBlockMetaOwner()
protected abstract MetaCollection<T> collect()
public <M extends BlockMeta<T>> M obtainMeta(Class<M> cls)
MetaOwner
obtainMeta
in interface MetaOwner<BlockMeta<T extends MetaOwner>>
M
- the meta typecls
- the class type of the meta valuenull
if the meta is not ownedpublic <M extends BlockMeta<T>> M newMetaIfNull(Class<M> cls)
MetaOwner
newMetaIfNull
in interface MetaOwner<BlockMeta<T extends MetaOwner>>
M
- the metacls
- the meta typenull
if it could not be madepublic <M extends MetaOwner> MetaCollection<M> ownedMeta()
MetaOwner
public <M extends BlockMeta<T>> void applyMeta(M... meta)
MetaOwner
public <M extends BlockMeta<T>> boolean applyMeta(boolean replace, M... meta)
MetaOwner
Copyright © 2016. All rights reserved.