Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-10 05:20:04 +01:00
Improved profiling messages.
Dieser Commit ist enthalten in:
Ursprung
66b4735d62
Commit
78c78fee1f
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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.
|
||||
*
|
||||
|
@ -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);
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren