Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-10 05:20:04 +01:00
Fixed some NPE's for block types not in BlockType.
Dieser Commit ist enthalten in:
Ursprung
4c05050d73
Commit
04803de8b1
@ -563,10 +563,11 @@ public class SelectionCommands {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (Countable<Integer> c : distribution) {
|
for (Countable<Integer> c : distribution) {
|
||||||
|
BlockType block = BlockType.fromID(c.getID());
|
||||||
String str = String.format("%-7s (%.3f%%) %s #%d",
|
String str = String.format("%-7s (%.3f%%) %s #%d",
|
||||||
String.valueOf(c.getAmount()),
|
String.valueOf(c.getAmount()),
|
||||||
c.getAmount() / (double)size * 100,
|
c.getAmount() / (double)size * 100,
|
||||||
BlockType.fromID(c.getID()).getName(), c.getID());
|
block == null ? "Unknown" : block.getName(), c.getID());
|
||||||
player.print(str);
|
player.print(str);
|
||||||
|
|
||||||
if (args.hasFlag('c')) {
|
if (args.hasFlag('c')) {
|
||||||
|
@ -38,10 +38,11 @@ public class QueryTool implements BlockTool {
|
|||||||
|
|
||||||
LocalWorld world = clicked.getWorld();
|
LocalWorld world = clicked.getWorld();
|
||||||
BaseBlock block = (new EditSession(world, 0)).rawGetBlock(clicked);
|
BaseBlock block = (new EditSession(world, 0)).rawGetBlock(clicked);
|
||||||
|
BlockType type = BlockType.fromID(block.getType());
|
||||||
|
|
||||||
player.print("\u00A79@" + clicked + ": " + "\u00A7e"
|
player.print("\u00A79@" + clicked + ": " + "\u00A7e"
|
||||||
+ "#" + block.getType() + "\u00A77" + " ("
|
+ "#" + block.getType() + "\u00A77" + " ("
|
||||||
+ BlockType.fromID(block.getType()).getName() + ") "
|
+ (type == null ? "Unknown" : type.getName()) + ") "
|
||||||
+ "\u00A7f"
|
+ "\u00A7f"
|
||||||
+ "[" + block.getData() + "]" + " (" + world.getBlockLightLevel(clicked) + "/" + world.getBlockLightLevel(clicked.add(0, 1, 0)) + ")");
|
+ "[" + block.getData() + "]" + " (" + world.getBlockLightLevel(clicked) + "/" + world.getBlockLightLevel(clicked.add(0, 1, 0)) + ")");
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren