Package com.sk89q.worldedit.blocks
Class SkullBlock
java.lang.Object
com.sk89q.worldedit.world.block.BaseBlock
com.sk89q.worldedit.blocks.SkullBlock
- All Implemented Interfaces:
TileEntityBlock
,Pattern
,BlockStateHolder<BaseBlock>
,NbtValued
A skull block.
-
Constructor Summary
ConstructorDescriptionSkullBlock
(BlockState state) Construct the skull block with a default type of skelton.SkullBlock
(BlockState blockState, String owner) Construct the skull block with a given rotation and owner. -
Method Summary
Modifier and TypeMethodDescriptionGet the object's NBT data (tile entity data).getNbtId()
Return the name of the title entity ID.getOwner()
Get the skull's owner.boolean
Returns whether the block contains NBT data.void
setNbtData
(CompoundTag rootTag) Set the object's NBT data (tile entity data).void
Set the skull's owner.Methods inherited from class com.sk89q.worldedit.world.block.BaseBlock
equals, equalsFuzzy, getBlockType, getState, getStates, hashCode, toBaseBlock, toBaseBlock, toImmutableState, toString, with
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.sk89q.worldedit.world.block.BlockStateHolder
applyBlock, getAsString
-
Constructor Details
-
SkullBlock
Construct the skull block with a default type of skelton.- Parameters:
state
- BlockState to set
-
SkullBlock
Construct the skull block with a given rotation and owner. The type is assumed to be player unless owner is null or empty.- Parameters:
blockState
- BlockState to setowner
- name of player
-
-
Method Details
-
setOwner
Set the skull's owner. Automatically sets type to player if not empty or null.- Parameters:
owner
- player name to set the skull to
-
getOwner
Get the skull's owner. Returns null if unset.- Returns:
- player name or null
-
hasNbtData
public boolean hasNbtData()Description copied from interface:NbtValued
Returns whether the block contains NBT data.NbtValued.getNbtData()
must not return null if this method returns true.- Specified by:
hasNbtData
in interfaceNbtValued
- Overrides:
hasNbtData
in classBaseBlock
- Returns:
- true if there is NBT data
-
getNbtId
Description copied from interface:TileEntityBlock
Return the name of the title entity ID.- Specified by:
getNbtId
in interfaceTileEntityBlock
- Overrides:
getNbtId
in classBaseBlock
- Returns:
- tile entity ID, non-null string
-
getNbtData
Description copied from interface:NbtValued
Get the object's NBT data (tile entity data). The returned tag, if modified in any way, should be sent toNbtValued.setNbtData(CompoundTag)
so that the instance knows of the changes. Making changes without callingNbtValued.setNbtData(CompoundTag)
could have unintended consequences.NbtValued.hasNbtData()
must return true if and only if method does not return null.- Specified by:
getNbtData
in interfaceNbtValued
- Overrides:
getNbtData
in classBaseBlock
- Returns:
- compound tag, or null
-
setNbtData
Description copied from interface:NbtValued
Set the object's NBT data (tile entity data).- Specified by:
setNbtData
in interfaceNbtValued
- Overrides:
setNbtData
in classBaseBlock
- Parameters:
rootTag
- NBT data, or null if no data
-