mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 17:01:56 +01:00
Timings v2: Plugins don't always register commands properly
*mumbles*
This commit is contained in:
parent
496b49861c
commit
81f624837f
1 changed files with 12 additions and 0 deletions
|
@ -2900,6 +2900,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
this.label = name;
|
this.label = name;
|
||||||
return true;
|
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
|
diff --git a/src/main/java/org/bukkit/command/FormattedCommandAlias.java b/src/main/java/org/bukkit/command/FormattedCommandAlias.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/org/bukkit/command/FormattedCommandAlias.java
|
--- a/src/main/java/org/bukkit/command/FormattedCommandAlias.java
|
||||||
|
|
Loading…
Reference in a new issue