Add wiki link to /timings on command
This commit is contained in:
parent
61a227c8c3
commit
16afc3b31c
@ -1,4 +1,4 @@
|
|||||||
From f229e7b81ab44f89a86865d9c8200c20cb1f2aab Mon Sep 17 00:00:00 2001
|
From 679c0e51be354c5b317bd29bd2f487199519378e Mon Sep 17 00:00:00 2001
|
||||||
From: md_5 <md_5@live.com.au>
|
From: md_5 <md_5@live.com.au>
|
||||||
Date: Sun, 2 Jun 2013 11:17:05 +1000
|
Date: Sun, 2 Jun 2013 11:17:05 +1000
|
||||||
Subject: [PATCH] Enchanced Timings
|
Subject: [PATCH] Enchanced Timings
|
||||||
@ -17,7 +17,7 @@ index fb3c90f..ffbcac1 100644
|
|||||||
Command.broadcastCommandMessage(sender, ChatColor.GREEN + "Reload complete.");
|
Command.broadcastCommandMessage(sender, ChatColor.GREEN + "Reload complete.");
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/command/defaults/TimingsCommand.java b/src/main/java/org/bukkit/command/defaults/TimingsCommand.java
|
diff --git a/src/main/java/org/bukkit/command/defaults/TimingsCommand.java b/src/main/java/org/bukkit/command/defaults/TimingsCommand.java
|
||||||
index 7c28b75..1bc26c6 100644
|
index 7c28b75..e2fdf22 100644
|
||||||
--- a/src/main/java/org/bukkit/command/defaults/TimingsCommand.java
|
--- a/src/main/java/org/bukkit/command/defaults/TimingsCommand.java
|
||||||
+++ b/src/main/java/org/bukkit/command/defaults/TimingsCommand.java
|
+++ b/src/main/java/org/bukkit/command/defaults/TimingsCommand.java
|
||||||
@@ -35,7 +35,7 @@ public class TimingsCommand extends BukkitCommand {
|
@@ -35,7 +35,7 @@ public class TimingsCommand extends BukkitCommand {
|
||||||
@ -29,7 +29,7 @@ index 7c28b75..1bc26c6 100644
|
|||||||
this.setPermission("bukkit.command.timings");
|
this.setPermission("bukkit.command.timings");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,14 +46,33 @@ public class TimingsCommand extends BukkitCommand {
|
@@ -46,14 +46,34 @@ public class TimingsCommand extends BukkitCommand {
|
||||||
sender.sendMessage(ChatColor.RED + "Usage: " + usageMessage);
|
sender.sendMessage(ChatColor.RED + "Usage: " + usageMessage);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -44,6 +44,7 @@ index 7c28b75..1bc26c6 100644
|
|||||||
+ {
|
+ {
|
||||||
+ // ( (org.bukkit.plugin.SimplePluginManager) Bukkit.getPluginManager() ).useTimings( true );
|
+ // ( (org.bukkit.plugin.SimplePluginManager) Bukkit.getPluginManager() ).useTimings( true );
|
||||||
+ sender.sendMessage( ChatColor.RED + "This command is disabled as it does not produce accurate results. Please enable plugin-profiling in bukkit.yml and restart." );
|
+ sender.sendMessage( ChatColor.RED + "This command is disabled as it does not produce accurate results. Please enable plugin-profiling in bukkit.yml and restart." );
|
||||||
|
+ sender.sendMessage( ChatColor.RED + "Please see http://www.spigotmc.org/wiki/disabled-timings-on-command/ for further information." );
|
||||||
+ } else if ( "off".equals( args[0] ) )
|
+ } else if ( "off".equals( args[0] ) )
|
||||||
+ {
|
+ {
|
||||||
+ ( (org.bukkit.plugin.SimplePluginManager) Bukkit.getPluginManager() ).useTimings( false );
|
+ ( (org.bukkit.plugin.SimplePluginManager) Bukkit.getPluginManager() ).useTimings( false );
|
||||||
@ -65,7 +66,7 @@ index 7c28b75..1bc26c6 100644
|
|||||||
for (HandlerList handlerList : HandlerList.getHandlerLists()) {
|
for (HandlerList handlerList : HandlerList.getHandlerLists()) {
|
||||||
for (RegisteredListener listener : handlerList.getRegisteredListeners()) {
|
for (RegisteredListener listener : handlerList.getRegisteredListeners()) {
|
||||||
if (listener instanceof TimedRegisteredListener) {
|
if (listener instanceof TimedRegisteredListener) {
|
||||||
@@ -61,10 +80,18 @@ public class TimingsCommand extends BukkitCommand {
|
@@ -61,10 +81,18 @@ public class TimingsCommand extends BukkitCommand {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -87,7 +88,7 @@ index 7c28b75..1bc26c6 100644
|
|||||||
int index = 0;
|
int index = 0;
|
||||||
int pluginIdx = 0;
|
int pluginIdx = 0;
|
||||||
File timingFolder = new File("timings");
|
File timingFolder = new File("timings");
|
||||||
@@ -99,12 +126,15 @@ public class TimingsCommand extends BukkitCommand {
|
@@ -99,12 +127,15 @@ public class TimingsCommand extends BukkitCommand {
|
||||||
totalTime += time;
|
totalTime += time;
|
||||||
Class<? extends Event> eventClass = trl.getEventClass();
|
Class<? extends Event> eventClass = trl.getEventClass();
|
||||||
if (count > 0 && eventClass != null) {
|
if (count > 0 && eventClass != null) {
|
||||||
@ -104,7 +105,7 @@ index 7c28b75..1bc26c6 100644
|
|||||||
fileTimings.println( "Sample time " + sampleTime + " (" + sampleTime / 1E9 + "s)" ); // Spigot
|
fileTimings.println( "Sample time " + sampleTime + " (" + sampleTime / 1E9 + "s)" ); // Spigot
|
||||||
// Spigot start
|
// Spigot start
|
||||||
if ( paste )
|
if ( paste )
|
||||||
@@ -114,6 +144,7 @@ public class TimingsCommand extends BukkitCommand {
|
@@ -114,6 +145,7 @@ public class TimingsCommand extends BukkitCommand {
|
||||||
}
|
}
|
||||||
// Spigot end
|
// Spigot end
|
||||||
sender.sendMessage("Timings written to " + timings.getPath());
|
sender.sendMessage("Timings written to " + timings.getPath());
|
||||||
|
Loading…
Reference in New Issue
Block a user