Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
org.bukkit.block.BlockState Interface Reference
Inheritance diagram for org.bukkit.block.BlockState:
org.bukkit.metadata.Metadatable org.bukkit.block.Beacon org.bukkit.block.BrewingStand org.bukkit.block.Chest org.bukkit.block.CommandBlock org.bukkit.block.CreatureSpawner org.bukkit.block.Dispenser org.bukkit.block.Dropper org.bukkit.block.Furnace org.bukkit.block.Hopper org.bukkit.block.Jukebox org.bukkit.block.NoteBlock org.bukkit.block.Sign org.bukkit.block.Skull

Public Member Functions

Block getBlock ()
 
MaterialData getData ()
 
Material getType ()
 
int getTypeId ()
 
byte getLightLevel ()
 
World getWorld ()
 
int getX ()
 
int getY ()
 
int getZ ()
 
Location getLocation ()
 
Location getLocation (Location loc)
 
Chunk getChunk ()
 
void setData (MaterialData data)
 
void setType (Material type)
 
boolean setTypeId (int type)
 
boolean update ()
 
boolean update (boolean force)
 
boolean update (boolean force, boolean applyPhysics)
 
byte getRawData ()
 
void setRawData (byte data)
 

Detailed Description

Represents a captured state of a block, which will not change automatically.

Unlike Block, which only one object can exist per coordinate, BlockState can exist multiple times for any given Block. Note that another plugin may change the state of the block and you will not know, or they may change the block to another type entirely, causing your BlockState to become invalid.

Definition at line 19 of file BlockState.java.

Member Function Documentation

Block org.bukkit.block.BlockState.getBlock ( )

Gets the block represented by this BlockState

Returns
Block that this BlockState represents
Chunk org.bukkit.block.BlockState.getChunk ( )

Gets the chunk which contains this block

Returns
Containing Chunk
MaterialData org.bukkit.block.BlockState.getData ( )

Gets the metadata for this block

Returns
block specific metadata
byte org.bukkit.block.BlockState.getLightLevel ( )

Gets the light level between 0-15

Returns
light level
Location org.bukkit.block.BlockState.getLocation ( )

Gets the location of this block

Returns
location
Location org.bukkit.block.BlockState.getLocation ( Location  loc)

Stores the location of this block in the provided Location object.

If the provided Location is null this method does nothing and returns null.

Returns
The Location object provided or null
byte org.bukkit.block.BlockState.getRawData ( )
Returns
The data as a raw byte.
Deprecated:
Magic value
Material org.bukkit.block.BlockState.getType ( )

Gets the type of this block

Returns
block type
int org.bukkit.block.BlockState.getTypeId ( )

Gets the type-id of this block

Returns
block type-id
Deprecated:
Magic value
World org.bukkit.block.BlockState.getWorld ( )

Gets the world which contains this Block

Returns
World containing this block
int org.bukkit.block.BlockState.getX ( )

Gets the x-coordinate of this block

Returns
x-coordinate
int org.bukkit.block.BlockState.getY ( )

Gets the y-coordinate of this block

Returns
y-coordinate
int org.bukkit.block.BlockState.getZ ( )

Gets the z-coordinate of this block

Returns
z-coordinate
void org.bukkit.block.BlockState.setData ( MaterialData  data)

Sets the metadata for this block

Parameters
dataNew block specific metadata
void org.bukkit.block.BlockState.setRawData ( byte  data)
Parameters
dataThe new data value for the block.
Deprecated:
Magic value
void org.bukkit.block.BlockState.setType ( Material  type)

Sets the type of this block

Parameters
typeMaterial to change this block to
boolean org.bukkit.block.BlockState.setTypeId ( int  type)

Sets the type-id of this block

Parameters
typeType-Id to change this block to
Returns
Whether it worked?
Deprecated:
Magic value
boolean org.bukkit.block.BlockState.update ( )

Attempts to update the block represented by this state, setting it to the new values as defined by this state.

This has the same effect as calling update(false). That is to say, this will not modify the state of a block if it is no longer the same type as it was when this state was taken. It will return false in this eventuality.

Returns
true if the update was successful, otherwise false
See also
update(boolean)
boolean org.bukkit.block.BlockState.update ( boolean  force)

Attempts to update the block represented by this state, setting it to the new values as defined by this state.

This has the same effect as calling update(force, true). That is to say, this will trigger a physics update to surrounding blocks.

Parameters
forcetrue to forcefully set the state
Returns
true if the update was successful, otherwise false
boolean org.bukkit.block.BlockState.update ( boolean  force,
boolean  applyPhysics 
)

Attempts to update the block represented by this state, setting it to the new values as defined by this state.

Unless force is true, this will not modify the state of a block if it is no longer the same type as it was when this state was taken. It will return false in this eventuality.

If force is true, it will set the type of the block to match the new state, set the state data and then return true.

If applyPhysics is true, it will trigger a physics update on surrounding blocks which could cause them to update or disappear.

Parameters
forcetrue to forcefully set the state
applyPhysicsfalse to cancel updating physics on surrounding blocks
Returns
true if the update was successful, otherwise false

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