Added light level to the query tool.

This commit is contained in:
sk89q 2011-04-29 23:15:09 -07:00
parent 3ffd67e7f3
commit 3ada3a9774
3 changed files with 21 additions and 2 deletions

View File

@ -80,6 +80,14 @@ public abstract class LocalWorld {
*/
public abstract int getBlockData(Vector pt);
/**
* Get block light level.
*
* @param pt
* @return
*/
public abstract int getBlockLightLevel(Vector pt);
/**
* Regenerate an area.
*

View File

@ -113,6 +113,17 @@ public class BukkitWorld extends LocalWorld {
return world.getBlockAt(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ()).getData();
}
/**
* Get block light level.
*
* @param pt
* @return
*/
@Override
public int getBlockLightLevel(Vector pt) {
return world.getBlockAt(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ()).getLightLevel();
}
/**
* Regenerate an area.
*

View File

@ -37,10 +37,10 @@ public class QueryTool implements BlockTool {
BaseBlock block = (new EditSession(world, 0)).rawGetBlock(clicked);
player.print("\u00A79@" + clicked + ": " + "\u00A7e"
+ "Type: " + block.getType() + "\u00A77" + " ("
+ "#" + block.getType() + "\u00A77" + " ("
+ BlockType.fromID(block.getType()).getName() + ") "
+ "\u00A7f"
+ "[" + block.getData() + "]");
+ "[" + block.getData() + "]" + " (" + world.getBlockLightLevel(clicked) + "/" + world.getBlockLightLevel(clicked.add(0, 1, 0)) + ")");
if (block instanceof MobSpawnerBlock) {
player.printRaw("\u00A7e" + "Mob Type: "