Files
CatServer/patches/net/minecraft/command/CommandDebug.java.patch
2019-02-24 22:29:41 +08:00

26 lines
1.2 KiB
Diff

--- ../src-base/minecraft/net/minecraft/command/CommandDebug.java
+++ ../src-work/minecraft/net/minecraft/command/CommandDebug.java
@@ -13,6 +13,7 @@
import net.minecraft.profiler.Profiler;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
+import net.minecraft.util.text.TextComponentString;
import org.apache.commons.io.IOUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -40,6 +41,14 @@
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
+ // CraftBukkit start - only allow use when enabled (so that no blank profile results occur)
+ if (!server.profiler.ENABLED) {
+ sender.sendMessage(new TextComponentString("Vanilla debug profiling is disabled."));
+ sender.sendMessage(new TextComponentString("To enable, restart the server with `-DenableDebugMethodProfiler=true' before `-jar'."));
+ sender.sendMessage(new TextComponentString("Use `/timings' for plugin timings."));
+ return;
+ }
+ // CraftBukkit end
if (args.length < 1)
{
throw new WrongUsageException("commands.debug.usage", new Object[0]);