Make a start on BlockState stuff
By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
108
paper-api/src/main/java/org/bukkit/block/BlockState.java
Normal file
108
paper-api/src/main/java/org/bukkit/block/BlockState.java
Normal file
@ -0,0 +1,108 @@
|
||||
|
||||
package org.bukkit.block;
|
||||
|
||||
import org.bukkit.Block;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public interface BlockState {
|
||||
/**
|
||||
* Gets the block represented by this BlockState
|
||||
*
|
||||
* @return Block that this BlockState represents
|
||||
*/
|
||||
Block getBlock();
|
||||
|
||||
/**
|
||||
* Gets the metadata for this block
|
||||
*
|
||||
* @return block specific metadata
|
||||
*/
|
||||
byte getData();
|
||||
|
||||
/**
|
||||
* Gets the type of this block
|
||||
*
|
||||
* @return block type
|
||||
*/
|
||||
Material getType();
|
||||
|
||||
/**
|
||||
* Gets the type-ID of this block
|
||||
*
|
||||
* @return block type-ID
|
||||
*/
|
||||
int getTypeID();
|
||||
|
||||
/**
|
||||
* Gets the light level between 0-15
|
||||
*
|
||||
* @return light level
|
||||
*/
|
||||
byte getLightLevel();
|
||||
|
||||
/**
|
||||
* Gets the world which contains this Block
|
||||
*
|
||||
* @return World containing this block
|
||||
*/
|
||||
World getWorld();
|
||||
|
||||
/**
|
||||
* Gets the x-coordinate of this block
|
||||
*
|
||||
* @return x-coordinate
|
||||
*/
|
||||
int getX();
|
||||
|
||||
/**
|
||||
* Gets the y-coordinate of this block
|
||||
*
|
||||
* @return y-coordinate
|
||||
*/
|
||||
int getY();
|
||||
|
||||
/**
|
||||
* Gets the z-coordinate of this block
|
||||
*
|
||||
* @return z-coordinate
|
||||
*/
|
||||
int getZ();
|
||||
|
||||
/**
|
||||
* Gets the chunk which contains this block
|
||||
*
|
||||
* @return Containing Chunk
|
||||
*/
|
||||
Chunk getChunk();
|
||||
|
||||
/**
|
||||
* Sets the metadata for this block
|
||||
*
|
||||
* @param data New block specific metadata
|
||||
*/
|
||||
void setData(byte data);
|
||||
|
||||
/**
|
||||
* Sets the type of this block
|
||||
*
|
||||
* @param type Material to change this block to
|
||||
*/
|
||||
void setType(Material type);
|
||||
|
||||
/**
|
||||
* Sets the type-ID of this block
|
||||
*
|
||||
* @param type Type-ID to change this block to
|
||||
*/
|
||||
void setTypeID(int type);
|
||||
}
|
||||
Reference in New Issue
Block a user