This commit is contained in:
Chayapak 2023-05-09 14:30:44 +07:00
parent 37261fa318
commit 14d07a0643
2 changed files with 4 additions and 6 deletions

View file

@ -79,11 +79,10 @@ public class CommandHandlerPlugin {
final Command command = ElementUtilities.findCommand(commands, commandName); final Command command = ElementUtilities.findCommand(commands, commandName);
// I think this is kinda annoying when you correct spelling mistakes or something like // I think this is kinda annoying when you correct spelling mistakes or something
// *whatever* (action or whatever you call it.,,.) so I removed the unknown command // so I made it return nothing if it's in game
// if (command == null) return Component.text("Unknown command: " + commandName).color(NamedTextColor.RED); if (command == null && !inGame) return Component.text("Unknown command: " + commandName).color(NamedTextColor.RED);
else if (command == null) return null;
if (command == null) return null;
final int trustLevel = command.trustLevel(); final int trustLevel = command.trustLevel();

View file

@ -4,7 +4,6 @@ import land.chipmunk.chayapak.chomens_bot.command.Command;
import java.util.List; import java.util.List;
// Author: ChatGPT I guess
public class ElementUtilities { public class ElementUtilities {
public static Command findCommand(List<Command> commands, String searchTerm) { public static Command findCommand(List<Command> commands, String searchTerm) {
for (Command command : commands) { for (Command command : commands) {