Package org.spongepowered.api.block
Interface BlockType
- All Superinterfaces:
ComponentLike
,DataHolder
,DataHolder.Immutable<BlockType>
,DefaultedRegistryValue
,StateContainer<BlockState>
,Taggable<BlockType>
,ValueContainer
@CatalogedBy(BlockTypes.class)
public interface BlockType
extends DefaultedRegistryValue, ComponentLike, StateContainer<BlockState>, DataHolder.Immutable<BlockType>, Taggable<BlockType>
Describes a base type of block.
Blocks are further differentiated using a BlockState
. Complex
data, such as inventory contents, are considered data, which is provided
via BlockEntity
.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.spongepowered.api.data.DataHolder
DataHolder.Immutable<I extends DataHolder.Immutable<I>>, DataHolder.Mutable
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Gets if this BlockType is set to receive random block ticks.boolean
Returns true if this type will have a block entity when placed in the worldboolean
Returns true if this type is any of the given block typesboolean
Returns true if this type is any of the given block typesitem()
Return theItemType
that represents this block.void
setUpdateRandomly
(boolean updateRandomly) Sets if the BlockType should receive random block updates.Gets theBlockSoundGroup
for this block.Methods inherited from interface net.kyori.adventure.text.ComponentLike
asComponent
Methods inherited from interface org.spongepowered.api.data.DataHolder.Immutable
mergeWith, mergeWith, transform, transform, with, with, with, without, without, without
Methods inherited from interface org.spongepowered.api.registry.DefaultedRegistryValue
asDefaultedReference, findKey, key
Methods inherited from interface org.spongepowered.api.state.StateContainer
defaultState, findStateProperty, stateProperties, validStates
Methods inherited from interface org.spongepowered.api.tag.Taggable
is, registryType, tags
-
Method Details
-
item
Return theItemType
that represents this block.- Returns:
- The item type or
Optional.empty()
otherwise
-
doesUpdateRandomly
boolean doesUpdateRandomly()Gets if this BlockType is set to receive random block ticks.Random block updates are most commonly used for growth of plants.
- Returns:
- If the BlockType updates randomly
-
setUpdateRandomly
void setUpdateRandomly(boolean updateRandomly) Sets if the BlockType should receive random block updates.Random block updates are most commonly used for growth of plants.
- Parameters:
updateRandomly
- If the BlockType should update randomly
-
soundGroup
BlockSoundGroup soundGroup()Gets theBlockSoundGroup
for this block.- Returns:
- This block's sound group.
-
isAnyOf
Returns true if this type is any of the given block types- Parameters:
types
- the block types to check- Returns:
- true if this type is any of the given block types
-
isAnyOf
Returns true if this type is any of the given block types- Parameters:
types
- the block types to check- Returns:
- true if this type is any of the given block types
-
hasBlockEntity
boolean hasBlockEntity()Returns true if this type will have a block entity when placed in the world- Returns:
- true if this type will have a block entity when placed in the world
-