Added light level to the query tool.

Dieser Commit ist enthalten in:
sk89q 2011-04-29 23:15:09 -07:00
Ursprung 3ffd67e7f3
Commit 3ada3a9774
3 geänderte Dateien mit 21 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -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.
*

Datei anzeigen

@ -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.
*

Datei anzeigen

@ -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: "