From 9f604a909d3e246730cef0d910369b13caa21aaf Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Thu, 15 Sep 2011 03:04:55 +0100 Subject: [PATCH] Fixed "unknown command" on vanilla commands with no args (even though it's intended behavior...) By: Dinnerbone --- .../src/main/java/org/bukkit/command/defaults/BanCommand.java | 2 +- .../src/main/java/org/bukkit/command/defaults/BanIpCommand.java | 2 +- .../src/main/java/org/bukkit/command/defaults/DeopCommand.java | 2 +- .../main/java/org/bukkit/command/defaults/GameModeCommand.java | 2 +- .../src/main/java/org/bukkit/command/defaults/GiveCommand.java | 2 +- .../src/main/java/org/bukkit/command/defaults/KickCommand.java | 2 +- .../src/main/java/org/bukkit/command/defaults/MeCommand.java | 2 +- .../src/main/java/org/bukkit/command/defaults/OpCommand.java | 2 +- .../main/java/org/bukkit/command/defaults/PardonCommand.java | 2 +- .../main/java/org/bukkit/command/defaults/PardonIpCommand.java | 2 +- .../src/main/java/org/bukkit/command/defaults/SayCommand.java | 2 +- .../main/java/org/bukkit/command/defaults/TeleportCommand.java | 2 +- .../src/main/java/org/bukkit/command/defaults/TellCommand.java | 2 +- .../src/main/java/org/bukkit/command/defaults/TimeCommand.java | 2 +- .../main/java/org/bukkit/command/defaults/WhitelistCommand.java | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/paper-api/src/main/java/org/bukkit/command/defaults/BanCommand.java b/paper-api/src/main/java/org/bukkit/command/defaults/BanCommand.java index 7d6b0ffa01..d415835b42 100644 --- a/paper-api/src/main/java/org/bukkit/command/defaults/BanCommand.java +++ b/paper-api/src/main/java/org/bukkit/command/defaults/BanCommand.java @@ -29,6 +29,6 @@ public class BanCommand extends VanillaCommand { @Override public boolean matches(String input) { - return input.startsWith("ban "); + return input.startsWith("ban ") || input.equalsIgnoreCase("ban"); } } diff --git a/paper-api/src/main/java/org/bukkit/command/defaults/BanIpCommand.java b/paper-api/src/main/java/org/bukkit/command/defaults/BanIpCommand.java index e03a3cb34e..e2c1c5276f 100644 --- a/paper-api/src/main/java/org/bukkit/command/defaults/BanIpCommand.java +++ b/paper-api/src/main/java/org/bukkit/command/defaults/BanIpCommand.java @@ -29,6 +29,6 @@ public class BanIpCommand extends VanillaCommand { @Override public boolean matches(String input) { - return input.startsWith("ban-ip "); + return input.startsWith("ban-ip ") || input.equalsIgnoreCase("ban-ip"); } } diff --git a/paper-api/src/main/java/org/bukkit/command/defaults/DeopCommand.java b/paper-api/src/main/java/org/bukkit/command/defaults/DeopCommand.java index 29b5d95786..a01327dcd2 100644 --- a/paper-api/src/main/java/org/bukkit/command/defaults/DeopCommand.java +++ b/paper-api/src/main/java/org/bukkit/command/defaults/DeopCommand.java @@ -37,6 +37,6 @@ public class DeopCommand extends VanillaCommand { @Override public boolean matches(String input) { - return input.startsWith("deop "); + return input.startsWith("deop ") || input.equalsIgnoreCase("deop"); } } diff --git a/paper-api/src/main/java/org/bukkit/command/defaults/GameModeCommand.java b/paper-api/src/main/java/org/bukkit/command/defaults/GameModeCommand.java index 9962dc6a2a..071ce32cc2 100644 --- a/paper-api/src/main/java/org/bukkit/command/defaults/GameModeCommand.java +++ b/paper-api/src/main/java/org/bukkit/command/defaults/GameModeCommand.java @@ -54,6 +54,6 @@ public class GameModeCommand extends VanillaCommand { @Override public boolean matches(String input) { - return input.startsWith("gamemode "); + return input.startsWith("gamemode ") || input.equalsIgnoreCase("gamemode"); } } diff --git a/paper-api/src/main/java/org/bukkit/command/defaults/GiveCommand.java b/paper-api/src/main/java/org/bukkit/command/defaults/GiveCommand.java index 25dbd84da6..17cae71b90 100644 --- a/paper-api/src/main/java/org/bukkit/command/defaults/GiveCommand.java +++ b/paper-api/src/main/java/org/bukkit/command/defaults/GiveCommand.java @@ -56,6 +56,6 @@ public class GiveCommand extends VanillaCommand { @Override public boolean matches(String input) { - return input.startsWith("give "); + return input.startsWith("give ") || input.equalsIgnoreCase("give"); } } diff --git a/paper-api/src/main/java/org/bukkit/command/defaults/KickCommand.java b/paper-api/src/main/java/org/bukkit/command/defaults/KickCommand.java index e3b5a08bbb..85feeb54a5 100644 --- a/paper-api/src/main/java/org/bukkit/command/defaults/KickCommand.java +++ b/paper-api/src/main/java/org/bukkit/command/defaults/KickCommand.java @@ -36,6 +36,6 @@ public class KickCommand extends VanillaCommand { @Override public boolean matches(String input) { - return input.startsWith("kick "); + return input.startsWith("kick ") || input.equalsIgnoreCase("kick"); } } diff --git a/paper-api/src/main/java/org/bukkit/command/defaults/MeCommand.java b/paper-api/src/main/java/org/bukkit/command/defaults/MeCommand.java index 8c079415bb..9dd8c2bb9b 100644 --- a/paper-api/src/main/java/org/bukkit/command/defaults/MeCommand.java +++ b/paper-api/src/main/java/org/bukkit/command/defaults/MeCommand.java @@ -34,6 +34,6 @@ public class MeCommand extends VanillaCommand { @Override public boolean matches(String input) { - return input.startsWith("me "); + return input.startsWith("me ") || input.equalsIgnoreCase("me"); } } diff --git a/paper-api/src/main/java/org/bukkit/command/defaults/OpCommand.java b/paper-api/src/main/java/org/bukkit/command/defaults/OpCommand.java index 36ee25a7d8..76d6cc1062 100644 --- a/paper-api/src/main/java/org/bukkit/command/defaults/OpCommand.java +++ b/paper-api/src/main/java/org/bukkit/command/defaults/OpCommand.java @@ -37,6 +37,6 @@ public class OpCommand extends VanillaCommand { @Override public boolean matches(String input) { - return input.startsWith("op "); + return input.startsWith("op ") || input.equalsIgnoreCase("op"); } } diff --git a/paper-api/src/main/java/org/bukkit/command/defaults/PardonCommand.java b/paper-api/src/main/java/org/bukkit/command/defaults/PardonCommand.java index 866cccf7d2..d7636c7f98 100644 --- a/paper-api/src/main/java/org/bukkit/command/defaults/PardonCommand.java +++ b/paper-api/src/main/java/org/bukkit/command/defaults/PardonCommand.java @@ -29,6 +29,6 @@ public class PardonCommand extends VanillaCommand { @Override public boolean matches(String input) { - return input.startsWith("pardon "); + return input.startsWith("pardon ") || input.equalsIgnoreCase("pardon"); } } diff --git a/paper-api/src/main/java/org/bukkit/command/defaults/PardonIpCommand.java b/paper-api/src/main/java/org/bukkit/command/defaults/PardonIpCommand.java index 83bd2ccb56..732161ff2a 100644 --- a/paper-api/src/main/java/org/bukkit/command/defaults/PardonIpCommand.java +++ b/paper-api/src/main/java/org/bukkit/command/defaults/PardonIpCommand.java @@ -29,6 +29,6 @@ public class PardonIpCommand extends VanillaCommand { @Override public boolean matches(String input) { - return input.startsWith("pardon-ip "); + return input.startsWith("pardon-ip ") || input.equalsIgnoreCase("pardon-ip"); } } diff --git a/paper-api/src/main/java/org/bukkit/command/defaults/SayCommand.java b/paper-api/src/main/java/org/bukkit/command/defaults/SayCommand.java index 080d335efc..f26dbe9373 100644 --- a/paper-api/src/main/java/org/bukkit/command/defaults/SayCommand.java +++ b/paper-api/src/main/java/org/bukkit/command/defaults/SayCommand.java @@ -39,6 +39,6 @@ public class SayCommand extends VanillaCommand { @Override public boolean matches(String input) { - return input.startsWith("say "); + return input.startsWith("say ") || input.equalsIgnoreCase("say"); } } diff --git a/paper-api/src/main/java/org/bukkit/command/defaults/TeleportCommand.java b/paper-api/src/main/java/org/bukkit/command/defaults/TeleportCommand.java index aa2321fbac..0cc63cfdbe 100644 --- a/paper-api/src/main/java/org/bukkit/command/defaults/TeleportCommand.java +++ b/paper-api/src/main/java/org/bukkit/command/defaults/TeleportCommand.java @@ -39,6 +39,6 @@ public class TeleportCommand extends VanillaCommand { @Override public boolean matches(String input) { - return input.startsWith("tp "); + return input.startsWith("tp ") || input.equalsIgnoreCase("tp"); } } 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 69dd97455c..92cbd74e0f 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 @@ -49,6 +49,6 @@ public class TellCommand extends VanillaCommand { @Override public boolean matches(String input) { - return input.startsWith("tell "); + return input.startsWith("tell ") || input.equalsIgnoreCase("tell"); } } diff --git a/paper-api/src/main/java/org/bukkit/command/defaults/TimeCommand.java b/paper-api/src/main/java/org/bukkit/command/defaults/TimeCommand.java index 63f67ba7f8..a9e6a9fe73 100644 --- a/paper-api/src/main/java/org/bukkit/command/defaults/TimeCommand.java +++ b/paper-api/src/main/java/org/bukkit/command/defaults/TimeCommand.java @@ -59,6 +59,6 @@ public class TimeCommand extends VanillaCommand { @Override public boolean matches(String input) { - return input.startsWith("time "); + return input.startsWith("time ") || input.equalsIgnoreCase("time"); } } diff --git a/paper-api/src/main/java/org/bukkit/command/defaults/WhitelistCommand.java b/paper-api/src/main/java/org/bukkit/command/defaults/WhitelistCommand.java index 749ccdf264..272a062e0c 100644 --- a/paper-api/src/main/java/org/bukkit/command/defaults/WhitelistCommand.java +++ b/paper-api/src/main/java/org/bukkit/command/defaults/WhitelistCommand.java @@ -85,6 +85,6 @@ public class WhitelistCommand extends VanillaCommand { @Override public boolean matches(String input) { - return input.startsWith("whitelist "); + return input.startsWith("whitelist ") || input.equalsIgnoreCase("whitelist"); } }