From 81f624837f4f6de7f15826d6f6559fbae05b5818 Mon Sep 17 00:00:00 2001 From: Zach Brown <1254957+zachbr@users.noreply.github.com> Date: Sat, 30 Apr 2016 00:09:29 -0500 Subject: [PATCH] Timings v2: Plugins don't always register commands properly *mumbles* --- Spigot-API-Patches/Timings-v2.patch | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Spigot-API-Patches/Timings-v2.patch b/Spigot-API-Patches/Timings-v2.patch index e7f81f1e91..c2cdcba433 100644 --- a/Spigot-API-Patches/Timings-v2.patch +++ b/Spigot-API-Patches/Timings-v2.patch @@ -2900,6 +2900,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.label = name; return true; } +@@ -0,0 +0,0 @@ public abstract class Command { + public boolean register(CommandMap commandMap) { + if (allowChangesFrom(commandMap)) { + this.commandMap = commandMap; ++ // Paper start - Some plugins do things the wrong way, try and account for that ++ if (this.timings == null) { ++ this.timings = co.aikar.timings.TimingsManager.getCommandTiming("unknown", this); ++ } ++ // Paper end + return true; + } + diff --git a/src/main/java/org/bukkit/command/FormattedCommandAlias.java b/src/main/java/org/bukkit/command/FormattedCommandAlias.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/command/FormattedCommandAlias.java