mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 09:47:38 +00:00
Improved profiling messages.
This commit is contained in:
parent
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());
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user