From 089c229c1db69905a8ad209891c66753672107a1 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sun, 12 Jun 2011 16:35:26 +0100 Subject: [PATCH] Fixed fallbackPrefix not being lowercased, which would break prefixes for plugins with an uppercase char in the name By: stevenh --- .../src/main/java/org/bukkit/command/SimpleCommandMap.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/paper-api/src/main/java/org/bukkit/command/SimpleCommandMap.java b/paper-api/src/main/java/org/bukkit/command/SimpleCommandMap.java index 589d962c36..33568315c7 100644 --- a/paper-api/src/main/java/org/bukkit/command/SimpleCommandMap.java +++ b/paper-api/src/main/java/org/bukkit/command/SimpleCommandMap.java @@ -87,11 +87,12 @@ public final class SimpleCommandMap implements CommandMap { return false; } + String lowerPrefix = fallbackPrefix.trim().toLowerCase(); boolean registerdPassedLabel = true; // If the command exists but is an alias we overwrite it, otherwise we rename it based on the fallbackPrefix while (knownCommands.containsKey(lowerLabel) && !aliases.contains(lowerLabel)) { - lowerLabel = fallbackPrefix + ":" + lowerLabel; + lowerLabel = lowerPrefix + ":" + lowerLabel; registerdPassedLabel = false; }