|
| Block | getBlock () |
| | Gets the block represented by this BlockState.
|
| |
| MaterialData | getData () |
| | Gets the metadata for this block.
|
| |
| Material | getType () |
| | Gets the type of this block.
|
| |
| int | getTypeId () |
| | Gets the type-id of this block.
|
| |
| byte | getLightLevel () |
| | Gets the light level between 0-15.
|
| |
| World | getWorld () |
| | Gets the world which contains this Block.
|
| |
| int | getX () |
| | Gets the x-coordinate of this block.
|
| |
| int | getY () |
| | Gets the y-coordinate of this block.
|
| |
| int | getZ () |
| | Gets the z-coordinate of this block.
|
| |
| Location | getLocation () |
| | Gets the location of this block.
|
| |
| Location | getLocation (Location loc) |
| | Stores the location of this block in the provided Location object.
|
| |
| Chunk | getChunk () |
| | Gets the chunk which contains this block.
|
| |
| void | setData (MaterialData data) |
| | Sets the metadata for this block.
|
| |
| void | setType (Material type) |
| | Sets the type of this block.
|
| |
| boolean | setTypeId (int type) |
| | Sets the type-id of this block.
|
| |
| boolean | update () |
| | Attempts to update the block represented by this state, setting it to the new values as defined by this state.
|
| |
| boolean | update (boolean force) |
| | Attempts to update the block represented by this state, setting it to the new values as defined by this state.
|
| |
| byte | getRawData () |
| |
| void | setRawData (byte data) |
| |
| void | setMetadata (String metadataKey, MetadataValue newMetadataValue) |
| | Sets a metadata value in the implementing object's metadata store.
|
| |
| List< MetadataValue > | getMetadata (String metadataKey) |
| | Returns a list of previously set metadata values from the implementing object's metadata store.
|
| |
| boolean | hasMetadata (String metadataKey) |
| | Tests to see whether the implementing object contains the given metadata value in its metadata store.
|
| |
| void | removeMetadata (String metadataKey, Plugin owningPlugin) |
| | Removes the given metadata value from the implementing object's metadata store.
|
| |
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 18 of file BlockState.java.
| 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.
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.
- Parameters
-
| force | true to forcefully set the state |
- Returns
- true if the update was successful, otherwise false