Timings v2: Plugins don't always register commands properly

*mumbles*
This commit is contained in:
Zach Brown 2016-04-30 00:09:29 -05:00
parent 496b49861c
commit 81f624837f

View file

@ -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