AutoReferee  2.5
 All Classes Functions Variables
org.mctourney.autoreferee.util.BlockData Class Reference

Represents a type of block, combined with any identifiable metadata. More...

Public Member Functions

 BlockData (Material material, byte data)
 Constructs a block data object with a material and metadata. More...
 
 BlockData (ItemStack item)
 Constructs a block data object from an itemstack.
 
 BlockData (Material material)
 Constructs a block data object with a material and any metadata. More...
 
byte getData ()
 Gets the metadata value.
 
String getDisplayName ()
 Gets a human-readable name for this block data. More...
 
Material getMaterial ()
 Gets the material type.
 
String getName ()
 Gets a human-readable name for this block data, without color. More...
 
boolean matchesBlock (Block block)
 Checks if the specified block matches this block data, taking metadata into account. More...
 
void setData (byte data)
 Sets the metadata value.
 
void setMaterial (Material mat)
 Sets the material type.
 

Static Public Member Functions

static BlockData fromBlock (Block block)
 Generates a block data object from a block. More...
 
static BlockData fromInventory (Inventory inv)
 Generates a block data object from an inventory. More...
 
static BlockData fromItemStack (ItemStack item)
 Generates a block data object from an item stack. More...
 
static BlockData unserialize (String string)
 Unserializes a block data object from a comma-seperated string. More...
 

Detailed Description

Represents a type of block, combined with any identifiable metadata.

Author
authorblues

Constructor & Destructor Documentation

org.mctourney.autoreferee.util.BlockData.BlockData ( Material  material,
byte  data 
)

Constructs a block data object with a material and metadata.

Parameters
materialmaterial type
datametadata value, or -1 if any metadata
org.mctourney.autoreferee.util.BlockData.BlockData ( Material  material)

Constructs a block data object with a material and any metadata.

Parameters
materialmaterial type

Member Function Documentation

static BlockData org.mctourney.autoreferee.util.BlockData.fromBlock ( Block  block)
static

Generates a block data object from a block.

Parameters
blockblock object
Returns
block data object
static BlockData org.mctourney.autoreferee.util.BlockData.fromInventory ( Inventory  inv)
static

Generates a block data object from an inventory.

If an inventory contains more than one type of block, the block of the most quantity is returned.

Parameters
invinventory object
Returns
block data object
static BlockData org.mctourney.autoreferee.util.BlockData.fromItemStack ( ItemStack  item)
static

Generates a block data object from an item stack.

Parameters
itemitem stack object
Returns
block data object
String org.mctourney.autoreferee.util.BlockData.getDisplayName ( )

Gets a human-readable name for this block data.

Returns
colored block data name
String org.mctourney.autoreferee.util.BlockData.getName ( )

Gets a human-readable name for this block data, without color.

Returns
block data name
boolean org.mctourney.autoreferee.util.BlockData.matchesBlock ( Block  block)

Checks if the specified block matches this block data, taking metadata into account.

Returns
true if block matches, otherwise false
static BlockData org.mctourney.autoreferee.util.BlockData.unserialize ( String  string)
static

Unserializes a block data object from a comma-seperated string.

Parameters
stringserialized block data object
Returns
block data object

The documentation for this class was generated from the following file: