From 2244f53bdd090d8ebccdd6c94b6ece5e704110a1 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Mon, 10 Feb 2014 12:36:00 -0500 Subject: [PATCH] [Bleeding] Update Tell and Help aliases to use alias system. By: t00thpick1 --- .../java/org/bukkit/command/defaults/HelpCommand.java | 7 ++----- .../java/org/bukkit/command/defaults/TellCommand.java | 9 +++------ 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/paper-api/src/main/java/org/bukkit/command/defaults/HelpCommand.java b/paper-api/src/main/java/org/bukkit/command/defaults/HelpCommand.java index db3d92d01e..ff73b26fa4 100644 --- a/paper-api/src/main/java/org/bukkit/command/defaults/HelpCommand.java +++ b/paper-api/src/main/java/org/bukkit/command/defaults/HelpCommand.java @@ -1,6 +1,7 @@ package org.bukkit.command.defaults; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -28,6 +29,7 @@ public class HelpCommand extends VanillaCommand { super("help"); this.description = "Shows the help menu"; this.usageMessage = "/help \n/help \n/help "; + this.setAliases(Arrays.asList(new String[] { "?" })); this.setPermission("bukkit.command.help"); } @@ -109,11 +111,6 @@ public class HelpCommand extends VanillaCommand { return true; } - @Override - public boolean matches(String input) { - return input.equalsIgnoreCase("help") || input.equalsIgnoreCase("?"); - } - @Override public List tabComplete(CommandSender sender, String alias, String[] args) { Validate.notNull(sender, "Sender cannot be null"); diff --git a/paper-api/src/main/java/org/bukkit/command/defaults/TellCommand.java b/paper-api/src/main/java/org/bukkit/command/defaults/TellCommand.java index d0aa102ed7..287f49f892 100644 --- a/paper-api/src/main/java/org/bukkit/command/defaults/TellCommand.java +++ b/paper-api/src/main/java/org/bukkit/command/defaults/TellCommand.java @@ -1,9 +1,10 @@ package org.bukkit.command.defaults; +import java.util.Arrays; + import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; -import org.bukkit.command.ConsoleCommandSender; import org.bukkit.entity.Player; public class TellCommand extends VanillaCommand { @@ -11,6 +12,7 @@ public class TellCommand extends VanillaCommand { super("tell"); this.description = "Sends a private message to the given player"; this.usageMessage = "/tell "; + this.setAliases(Arrays.asList(new String[] { "w", "msg" })); this.setPermission("bukkit.command.tell"); } @@ -43,9 +45,4 @@ public class TellCommand extends VanillaCommand { return true; } - - @Override - public boolean matches(String input) { - return input.equalsIgnoreCase("tell") || input.equalsIgnoreCase("w") || input.equalsIgnoreCase("msg"); - } }