3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-12-25 02:20:07 +01:00

Improved profiling messages.

Dieser Commit ist enthalten in:
sk89q 2011-01-31 23:51:55 -08:00
Ursprung 66b4735d62
Commit 78c78fee1f
4 geänderte Dateien mit 30 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -2159,4 +2159,13 @@ public class EditSession {
public LocalWorld getWorld() {
return world;
}
/**
* Get the number of blocks changed, including repeated block changes.
*
* @return
*/
public int getBlockChangeCount() {
return original.size();
}
}

Datei anzeigen

@ -483,6 +483,13 @@ public abstract class LocalPlayer {
*/
public abstract void printRaw(String msg);
/**
* Print a WorldEdit message.
*
* @param msg
*/
public abstract void printDebug(String msg);
/**
* Print a WorldEdit message.
*

Datei anzeigen

@ -849,7 +849,15 @@ public class WorldEdit {
if (config.profile) {
long time = System.currentTimeMillis() - start;
player.print((time / 1000.0) + "s elapsed");
int changed = editSession.getBlockChangeCount();
if (time > 0) {
double throughput = changed / (time / 1000.0);
player.printDebug((time / 1000.0) + "s elapsed (history: "
+ changed + " changed; "
+ Math.round(throughput) + " blocks/sec).");
} else {
player.printDebug((time / 1000.0) + "s elapsed.");
}
}
flushBlockBag(player, editSession);

Datei anzeigen

@ -79,6 +79,11 @@ public class BukkitPlayer extends LocalPlayer {
player.sendMessage("\u00A7d" + msg);
}
@Override
public void printDebug(String msg) {
player.sendMessage("\u00A77" + msg);
}
@Override
public void printError(String msg) {
player.sendMessage("\u00A7c" + msg);
@ -109,5 +114,4 @@ public class BukkitPlayer extends LocalPlayer {
public LocalWorld getWorld() {
return new BukkitWorld(player.getWorld());
}
}