public class BlockData extends java.lang.Object implements ConfigSerialization.StringSerializable, java.lang.Comparable<BlockData>
Modifier and Type | Field and Description |
---|---|
boolean |
anydata
True if the BlockData can be applied to any subtype of the
block
|
short |
data
The requested subtype of the block
|
int |
id
The requested type of the block
|
org.bukkit.Material |
material
The requested type of the block
|
Constructor and Description |
---|
BlockData(org.bukkit.block.Block b)
Constructs a new BlockData representing the type of the given
block
|
BlockData(org.bukkit.block.BlockState b)
Constructs a new BlockData representing the type of the given
block state
|
BlockData(int id)
Constructs a new BlockData with the allowing any subtypes of the
given item/block id
|
BlockData(int id,
short data)
Constructs a new BlockData of the given item/block id and
subtype
|
BlockData(org.bukkit.inventory.ItemStack is)
Makes a new BlockData from an ItemStack
|
BlockData(org.bukkit.Material type)
|
BlockData(org.bukkit.Material type,
short durability)
|
BlockData(java.lang.String in)
Makes a new Block data from a String, which should have format
[itemId|itemName][:subType]
|
Modifier and Type | Method and Description |
---|---|
BlockData
|
clone()
Makes a copy of the BlockData, storing all it's parameters
|
int |
compareTo(BlockData o)
|
boolean |
equals(java.lang.Object obj)
|
org.bukkit.Material |
getType()
|
int |
hashCode()
|
boolean |
isBlock(org.bukkit.block.Block b)
Checks if the given block has the same type as this block data.
|
void |
sendChange(org.bukkit.entity.Player plr,
org.bukkit.Location loc)
|
void |
setBlock(org.bukkit.block.Block b)
Sets the given blocks type and id to the one stored by this
BlockData with allowing Minecraft physics calculations.
|
void |
setBlockNoPhysics(org.bukkit.block.Block b)
Sets the given blocks type and id to the one stored by this
BlockData without allowing Minecraft physics calculations.
|
org.bukkit.inventory.ItemStack |
toItem()
Converts this block data to an item
|
java.lang.String |
toString()
|
public boolean anydata
public short data
public int id
public org.bukkit.Material material
public BlockData(org.bukkit.block.Block b)
b
- - Target Blockpublic BlockData(org.bukkit.block.BlockState b)
b
- - Target Blockpublic BlockData(int id)
id
- - The wanted block / item idpublic BlockData(int id, short data)
id
- - The items / blocks iddata
- - The items / blocks subtypepublic BlockData(java.lang.String in)
in
- - The convertable Stringpublic BlockData(org.bukkit.inventory.ItemStack is)
is
- - The convertable ItemStackpublic BlockData(org.bukkit.Material type)
public BlockData(org.bukkit.Material type, short durability)
public int compareTo(BlockData o)
compareTo
in interface java.lang.Comparable<BlockData>
public org.bukkit.Material getType()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public BlockData clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in
interface ConfigSerialization.StringSerializable
toString
in class java.lang.Object
public boolean isBlock(org.bukkit.block.Block b)
b
- - Checkable blockpublic void sendChange(org.bukkit.entity.Player plr, org.bukkit.Location loc)
public void setBlock(org.bukkit.block.Block b)
b
- - Setable blockpublic void setBlockNoPhysics(org.bukkit.block.Block b)
b
- - Setable blockpublic org.bukkit.inventory.ItemStack toItem()