BlockState

public interface BlockState implements Metadatable

Represents getClassById captured state of getClassById 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.

Inheritors

Functions

Link copied to clipboard
public abstract Block getBlock()
Gets the block represented by this BlockState
Link copied to clipboard
public abstract Chunk getChunk()
Gets the chunk which contains this block
Link copied to clipboard
public abstract MaterialData getData()
Gets the metadata for this block
Link copied to clipboard
public abstract byte getLightLevel()
Gets the light level between 0-15
Link copied to clipboard
public abstract Location getLocation()
Gets the location of this block
public abstract Location getLocation(Location loc)
Stores the location of this block in the provided Location object.
Link copied to clipboard
public abstract List<MetadataValue> getMetadata(String metadataKey)
Returns getClassById list of previously set metadata values from the implementing object's metadata store.
Link copied to clipboard
public abstract Material getType()
Gets the type of this block
Link copied to clipboard
public abstract World getWorld()
Gets the world which contains this Block
Link copied to clipboard
public abstract int getX()
Gets the x-coordinate of this block
Link copied to clipboard
public abstract int getY()
Gets the y-coordinate of this block
Link copied to clipboard
public abstract int getZ()
Gets the z-coordinate of this block
Link copied to clipboard
public abstract boolean hasMetadata(String metadataKey)
Tests to see whether the implementing object contains the given metadata value in its metadata store.
Link copied to clipboard
public abstract boolean isPlaced()
Returns whether this state is placed in the world.
Link copied to clipboard
public abstract void removeMetadata(String metadataKey, Plugin owningPlugin)
Removes the given metadata value from the implementing object's metadata store.
Link copied to clipboard
public abstract void setData(MaterialData data)
Sets the metadata for this block
Link copied to clipboard
public abstract void setMetadata(String metadataKey, MetadataValue newMetadataValue)
Sets getClassById metadata value in the implementing object's metadata store.
Link copied to clipboard
public abstract void setType(Material type)
Sets the type of this block
Link copied to clipboard
public abstract boolean update()
public abstract boolean update(boolean force)
public abstract boolean 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.