2011-04-21 15:27:18 +01:00
|
|
|
package org.bukkit;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A delegate for handling block changes. This serves as a direct interface
|
|
|
|
* between generation algorithms in the server implementation and utilizing
|
|
|
|
* code.
|
|
|
|
*/
|
|
|
|
public interface BlockChangeDelegate {
|
2011-05-14 23:22:54 +02:00
|
|
|
|
2011-04-21 15:27:18 +01:00
|
|
|
/**
|
|
|
|
* Set a block type at the specified coordinates.
|
2011-05-14 23:22:54 +02:00
|
|
|
*
|
2011-09-25 02:56:40 +01:00
|
|
|
* @param x X coordinate
|
|
|
|
* @param y Y coordinate
|
|
|
|
* @param z Z coordinate
|
|
|
|
* @param typeId New block ID
|
2011-04-21 15:27:18 +01:00
|
|
|
* @return true if the block was set successfully
|
|
|
|
*/
|
|
|
|
public boolean setRawTypeId(int x, int y, int z, int typeId);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set a block type and data at the specified coordinates.
|
2011-05-14 23:22:54 +02:00
|
|
|
*
|
2011-09-25 02:56:40 +01:00
|
|
|
* @param x X coordinate
|
|
|
|
* @param y Y coordinate
|
|
|
|
* @param z Z coordinate
|
|
|
|
* @param typeId New block ID
|
|
|
|
* @param data Block data
|
2011-04-21 15:27:18 +01:00
|
|
|
* @return true if the block was set successfully
|
|
|
|
*/
|
|
|
|
public boolean setRawTypeIdAndData(int x, int y, int z, int typeId, int data);
|
2011-05-14 23:22:54 +02:00
|
|
|
|
2011-04-21 15:27:18 +01:00
|
|
|
/**
|
|
|
|
* Get the block type at the location.
|
2011-12-25 16:02:30 +01:00
|
|
|
*
|
2011-09-25 02:56:40 +01:00
|
|
|
* @param x X coordinate
|
|
|
|
* @param y Y coordinate
|
|
|
|
* @param z Z coordinate
|
|
|
|
* @return The block ID
|
2011-04-21 15:27:18 +01:00
|
|
|
*/
|
|
|
|
public int getTypeId(int x, int y, int z);
|
2011-09-23 17:15:23 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the height of the world.
|
|
|
|
*
|
|
|
|
* @return Height of the world
|
|
|
|
*/
|
|
|
|
public int getHeight();
|
2012-03-01 15:27:34 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks if the specified block is empty (air) or not.
|
|
|
|
*
|
|
|
|
* @param x X coordinate
|
|
|
|
* @param y Y coordinate
|
|
|
|
* @param z Z coordinate
|
|
|
|
* @return True if the block is considered empty.
|
|
|
|
*/
|
|
|
|
public boolean isEmpty(int x, int y, int z);
|
2011-04-21 15:27:18 +01:00
|
|
|
}
|