mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Remove Timings
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
--- a/src/main/java/co/aikar/timings/TimedEventExecutor.java
|
||||
+++ b/src/main/java/co/aikar/timings/TimedEventExecutor.java
|
||||
@@ -80,9 +_,9 @@
|
||||
executor.execute(listener, event);
|
||||
return;
|
||||
}
|
||||
- try (Timing ignored = timings.startTiming()){
|
||||
+ //try (Timing ignored = timings.startTiming()){ // Purpur - Remove Timings
|
||||
executor.execute(listener, event);
|
||||
- }
|
||||
+ //} // Purpur - Remove Timings
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -0,0 +1,48 @@
|
||||
--- a/src/main/java/co/aikar/timings/Timing.java
|
||||
+++ b/src/main/java/co/aikar/timings/Timing.java
|
||||
@@ -39,6 +_,7 @@
|
||||
* @return Timing
|
||||
*/
|
||||
@NotNull
|
||||
+ @io.papermc.paper.annotation.DoNotUse // Purpur - Remove Timings
|
||||
Timing startTiming();
|
||||
|
||||
/**
|
||||
@@ -46,6 +_,7 @@
|
||||
*
|
||||
* Will automatically be called when this Timing is used with try-with-resources
|
||||
*/
|
||||
+ @io.papermc.paper.annotation.DoNotUse // Purpur - Remove Timings
|
||||
void stopTiming();
|
||||
|
||||
/**
|
||||
@@ -56,6 +_,7 @@
|
||||
* @return Timing
|
||||
*/
|
||||
@NotNull
|
||||
+ @io.papermc.paper.annotation.DoNotUse // Purpur - Remove Timings
|
||||
Timing startTimingIfSync();
|
||||
|
||||
/**
|
||||
@@ -65,12 +_,14 @@
|
||||
*
|
||||
* But only if we are on the primary thread.
|
||||
*/
|
||||
+ @io.papermc.paper.annotation.DoNotUse // Purpur - Remove Timings
|
||||
void stopTimingIfSync();
|
||||
|
||||
/**
|
||||
* @deprecated Doesn't do anything - Removed
|
||||
*/
|
||||
@Deprecated
|
||||
+ @io.papermc.paper.annotation.DoNotUse // Purpur - Remove Timings
|
||||
void abort();
|
||||
|
||||
/**
|
||||
@@ -82,5 +_,6 @@
|
||||
TimingHandler getTimingHandler();
|
||||
|
||||
@Override
|
||||
+ @io.papermc.paper.annotation.DoNotUse // Purpur - Remove Timings
|
||||
void close();
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
--- a/src/main/java/co/aikar/timings/Timings.java
|
||||
+++ b/src/main/java/co/aikar/timings/Timings.java
|
||||
@@ -124,7 +_,7 @@
|
||||
@NotNull
|
||||
public static Timing ofStart(@NotNull Plugin plugin, @NotNull String name, @Nullable Timing groupHandler) {
|
||||
Timing timing = of(plugin, name, groupHandler);
|
||||
- timing.startTiming();
|
||||
+ //timing.startTiming(); // Purpur - Remove Timings
|
||||
return timing;
|
||||
}
|
||||
|
||||
@@ -146,7 +_,7 @@
|
||||
*/
|
||||
public static void setTimingsEnabled(boolean enabled) {
|
||||
if (enabled && !warnedAboutDeprecationOnEnable) {
|
||||
- Bukkit.getLogger().severe(PlainTextComponentSerializer.plainText().serialize(deprecationMessage()));
|
||||
+ //Bukkit.getLogger().severe(PlainTextComponentSerializer.plainText().serialize(deprecationMessage())); // Purpur - Remove Timings
|
||||
warnedAboutDeprecationOnEnable = true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
--- a/src/main/java/co/aikar/timings/TimingsCommand.java
|
||||
+++ b/src/main/java/co/aikar/timings/TimingsCommand.java
|
||||
@@ -47,7 +_,7 @@
|
||||
public TimingsCommand(@NotNull String name) {
|
||||
super(name);
|
||||
this.description = "Manages Spigot Timings data to see performance of the server.";
|
||||
- this.usageMessage = "/timings <reset|report|on|off|verbon|verboff>";
|
||||
+ this.usageMessage = "/timings";// <reset|report|on|off|verbon|verboff>"; // Purpur - Remove Timings
|
||||
this.setPermission("bukkit.command.timings");
|
||||
}
|
||||
|
||||
@@ -57,7 +_,12 @@
|
||||
return true;
|
||||
}
|
||||
if (true) {
|
||||
- sender.sendMessage(Timings.deprecationMessage());
|
||||
+ // Purpur start - Remove Timings
|
||||
+ net.kyori.adventure.text.minimessage.MiniMessage mm = net.kyori.adventure.text.minimessage.MiniMessage.miniMessage();
|
||||
+ sender.sendMessage(mm.deserialize("<gold>Purpur has removed timings to save your performance. Please use <click:suggest_command:'/spark'><grey>/spark</grey></click> instead"));
|
||||
+ sender.sendMessage(mm.deserialize("<gold>For more information, view its documentation at"));
|
||||
+ sender.sendMessage(mm.deserialize("<gold><click:open_url:'https://spark.lucko.me/docs/Command-Usage'>https://spark.lucko.me/docs/Command-Usage</click>"));
|
||||
+ // Purpur end - Remove Timings
|
||||
return true;
|
||||
}
|
||||
if (args.length < 1) {
|
||||
@@ -118,7 +_,7 @@
|
||||
Preconditions.checkNotNull(args, "Arguments cannot be null");
|
||||
Preconditions.checkNotNull(alias, "Alias cannot be null");
|
||||
|
||||
- if (args.length == 1) {
|
||||
+ if (false && args.length == 1) { // Purpur - Remove Timings
|
||||
return StringUtil.copyPartialMatches(args[0], TIMINGS_SUBCOMMANDS,
|
||||
new ArrayList<String>(TIMINGS_SUBCOMMANDS.size()));
|
||||
}
|
||||
@@ -20,12 +20,17 @@
|
||||
// Paper start - Plugins do weird things to workaround normal registration
|
||||
if (target.timings == null) {
|
||||
target.timings = co.aikar.timings.TimingsManager.getCommandTiming(null, target);
|
||||
@@ -162,7 +_,7 @@
|
||||
@@ -160,10 +_,10 @@
|
||||
// Paper end
|
||||
|
||||
try {
|
||||
try (co.aikar.timings.Timing ignored = target.timings.startTiming()) { // Paper - use try with resources
|
||||
- try (co.aikar.timings.Timing ignored = target.timings.startTiming()) { // Paper - use try with resources
|
||||
+ //try (co.aikar.timings.Timing ignored = target.timings.startTiming()) { // Paper - use try with resources // Purpur - Remove Timings
|
||||
// Note: we don't return the result of target.execute as thats success / failure, we return handled (true) or not handled (false)
|
||||
- target.execute(sender, sentCommandLabel, Arrays.copyOfRange(args, 1, args.length));
|
||||
- } // target.timings.stopTiming(); // Spigot // Paper
|
||||
+ target.execute(sender, sentCommandLabel, parsedArgs); // Purpur - ExecuteCommandEvent
|
||||
} // target.timings.stopTiming(); // Spigot // Paper
|
||||
+ //} // target.timings.stopTiming(); // Spigot // Paper // Purpur - Remove Timings
|
||||
} catch (CommandException ex) {
|
||||
server.getPluginManager().callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerCommandException(ex, target, sender, args))); // Paper
|
||||
//target.timings.stopTiming(); // Spigot // Paper
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
--- a/src/main/java/org/spigotmc/CustomTimingsHandler.java
|
||||
+++ b/src/main/java/org/spigotmc/CustomTimingsHandler.java
|
||||
@@ -61,7 +_,7 @@
|
||||
handler = timing;
|
||||
}
|
||||
|
||||
- public void startTiming() { handler.startTiming(); }
|
||||
- public void stopTiming() { handler.stopTiming(); }
|
||||
+ public void startTiming() { /*handler.startTiming();*/ } // Purpur - Remove Timings
|
||||
+ public void stopTiming() { /*handler.stopTiming();*/ } // Purpur - Remove Timings
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user