3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-16 13:00:06 +01:00
Paper/nms-patches/CommandDebug.patch
2018-12-26 08:00:00 +11:00

33 Zeilen
1.9 KiB
Diff

--- a/net/minecraft/server/CommandDebug.java
+++ b/net/minecraft/server/CommandDebug.java
@@ -33,6 +33,14 @@
}
private static int a(CommandListenerWrapper commandlistenerwrapper) throws CommandSyntaxException {
+ // CraftBukkit start - only allow use when enabled (so that no blank profile results occur)
+ if (!commandlistenerwrapper.getServer().methodProfiler.ENABLED) {
+ commandlistenerwrapper.sendFailureMessage(new ChatComponentText("Vanilla debug profiling is disabled."));
+ commandlistenerwrapper.sendFailureMessage(new ChatComponentText("To enable, restart the server with `-DenableDebugMethodProfiler=true' before `-jar'."));
+ commandlistenerwrapper.sendFailureMessage(new ChatComponentText("Use `/timings' for plugin timings."));
+ return 0;
+ }
+ // CraftBukkit end
MinecraftServer minecraftserver = commandlistenerwrapper.getServer();
MethodProfiler methodprofiler = minecraftserver.methodProfiler;
@@ -46,6 +54,14 @@
}
private static int b(CommandListenerWrapper commandlistenerwrapper) throws CommandSyntaxException {
+ // CraftBukkit start - only allow use when enabled (so that no blank profile results occur)
+ if (!commandlistenerwrapper.getServer().methodProfiler.ENABLED) {
+ commandlistenerwrapper.sendFailureMessage(new ChatComponentText("Vanilla debug profiling is disabled."));
+ commandlistenerwrapper.sendFailureMessage(new ChatComponentText("To enable, restart the server with `-DenableDebugMethodProfiler=true' before `-jar'."));
+ commandlistenerwrapper.sendFailureMessage(new ChatComponentText("Use `/timings' for plugin timings."));
+ return 0;
+ }
+ // CraftBukkit end
MinecraftServer minecraftserver = commandlistenerwrapper.getServer();
MethodProfiler methodprofiler = minecraftserver.methodProfiler;