Package com.sk89q.worldedit.world.block
Class BlockType
java.lang.Object
com.sk89q.worldedit.world.block.BlockType
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
BlockType
(String id, int internalId, List<BlockState> states) BlockType
(String id, Function<BlockState, BlockState> values) -
Method Summary
Modifier and TypeMethodDescriptionboolean
apply
(Extent extent, BlockVector3 get, BlockVector3 set) applyBlock
(BlockVector3 position) Return aBaseBlock
for the given position.boolean
Gets a list of all possible states for this BlockType.Gets the default state of this block type.getId()
Gets the ID of this block.int
The internal index of this type.Gets the item representation of this block type, if it exists.int
Deprecated.int
Deprecated.int
Deprecated.Get the material for this BlockType.int
Deprecated.getName()
Deprecated.Gets the properties of this BlockType.Deprecated.<V> Property<V>
getProperty
(PropertyKey key) <V> Property<V>
getProperty
(String name) Gets a property by name.Gets the properties of this BlockType in akey->property
mapping.com.sk89q.worldedit.util.formatting.text.Component
Deprecated, for removal: This API element is subject to removal in a future version.Not working.int
hashCode()
boolean
Gets whether this block type has an item representation.boolean
hasProperty
(PropertyKey key) toMask()
toString()
withPropertyId
(int propertyId) Deprecated.withStateId
(int internalStateId) Deprecated.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.fastasyncworldedit.core.queue.Filter
appliesChunk, appliesLayer, applyChunk, finishChunk, fork, join
Methods inherited from interface com.sk89q.worldedit.function.pattern.Pattern
apply, applyBlock
-
Field Details
-
REGISTRY
-
-
Constructor Details
-
BlockType
-
BlockType
-
-
Method Details
-
getMaxStateId
Deprecated. -
getId
Gets the ID of this block. -
getRichName
public com.sk89q.worldedit.util.formatting.text.Component getRichName() -
getNamespace
-
getResource
-
getName
Deprecated.The name is now translatable, usegetRichName()
.Gets the name of this block, or the ID if the name cannot be found.- Returns:
- The name, or ID
-
withPropertyId
Deprecated. -
withStateId
Deprecated. -
getPropertyMap
Gets the properties of this BlockType in akey->property
mapping.- Returns:
- The properties map
-
getProperties
Gets the properties of this BlockType.- Returns:
- the properties
-
getPropertiesSet
Deprecated. -
getProperty
Gets a property by name.- Parameters:
name
- The name- Returns:
- The property
-
hasProperty
-
getProperty
-
getDefaultState
Gets the default state of this block type.- Returns:
- The default state
-
getFuzzyMatcher
-
getAllStates
Gets a list of all possible states for this BlockType.- Returns:
- All possible states
-
getState
Deprecated, for removal: This API element is subject to removal in a future version.Not working. Not necessarily for removal, but WARNING DO NOT USE FOR NOWGets a state of this BlockType with the given properties.- Returns:
- The state, if it exists
-
hasItemType
public boolean hasItemType()Gets whether this block type has an item representation.- Returns:
- If it has an item
-
getItemType
Gets the item representation of this block type, if it exists.- Returns:
- The item representation
-
getMaterial
Get the material for this BlockType.- Returns:
- The material
-
getLegacyCombinedId
Deprecated.Gets the legacy ID. Needed for legacy reasons.DO NOT USE THIS.
- Returns:
- legacy id or 0, if unknown
-
getLegacyId
Deprecated.Gets the legacy data. Needed for legacy reasons.DO NOT USE THIS.
- Returns:
- legacy data or 0, if unknown
-
getLegacyData
Deprecated.Gets the legacy data. Needed for legacy reasons.DO NOT USE THIS.
- Returns:
- legacy data or 0, if unknown
-
toString
-
getInternalId
public int getInternalId()The internal index of this type.This number is not necessarily consistent across restarts.
- Returns:
- internal id
-
hashCode
public int hashCode() -
equals
-
apply
- Specified by:
apply
in interfacePattern
- Throws:
WorldEditException
-
applyBlock
Description copied from interface:Pattern
Return aBaseBlock
for the given position.- Specified by:
applyBlock
in interfacePattern
- Parameters:
position
- the position- Returns:
- a block
-
toMask
-
toMask
-
getRichName()
.