mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 15:49:00 +01:00
Allow plugins to override Vanilla commands with aliases
Spigot broke this in 1.12, re-adding the logic back
This commit is contained in:
parent
104b4ec3ae
commit
95ae0890a6
1 changed files with 21 additions and 0 deletions
|
@ -0,0 +1,21 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Tue, 20 Jun 2017 18:58:35 -0400
|
||||
Subject: [PATCH] Allow plugins to override Vanilla commands with aliases
|
||||
|
||||
Spigot broke this in 1.12, re-adding the logic back
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
||||
index 6f733fe0..ac3d5035 100644
|
||||
--- a/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
||||
+++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
||||
@@ -0,0 +0,0 @@ public class SimpleCommandMap implements CommandMap {
|
||||
*/
|
||||
private synchronized boolean register(String label, Command command, boolean isAlias, String fallbackPrefix) {
|
||||
knownCommands.put(fallbackPrefix + ":" + label, command);
|
||||
- if (isAlias && knownCommands.containsKey(label)) {
|
||||
+ if (("minecraft".equals(fallbackPrefix) || isAlias) && knownCommands.containsKey(label)) { // Paper - allow plugins to override vanilla commands as aliases
|
||||
// Request is for an alias/fallback command and it conflicts with
|
||||
// a existing command or previous alias ignore it
|
||||
// Note: This will mean it gets removed from the commands list of active aliases
|
||||
--
|
Loading…
Reference in a new issue