diff --git a/ic_plugin/src/main/java/nl/interestingcorner/commands/AddCoordinateCommandHandler.java b/ic_plugin/src/main/java/nl/interestingcorner/commands/AddCoordinateCommandHandler.java index 2c049df..473f5b0 100644 --- a/ic_plugin/src/main/java/nl/interestingcorner/commands/AddCoordinateCommandHandler.java +++ b/ic_plugin/src/main/java/nl/interestingcorner/commands/AddCoordinateCommandHandler.java @@ -16,7 +16,7 @@ public class AddCoordinateCommandHandler implements CoordinatesCommandHandler { /** * Minimum arguments needed for adding a command: name, description, color */ - private final int MIN_ARGS = 3; + private final int MIN_ARGS = 4; @Override public boolean handleCommand(CommandSender sender, String[] args) { @@ -36,13 +36,13 @@ public class AddCoordinateCommandHandler implements CoordinatesCommandHandler { } return DatabaseManager.INSTANCE - .addCoordinate(args[0], // name - args[1], // description + .addCoordinate(args[1], // name + args[2], // description new Coordinate.Position(playerLocation.getBlockX(), playerLocation.getBlockY(), playerLocation.getBlockZ()), // position playerWorld.getEnvironment().equals(World.Environment.NETHER), // nether playerWorld.getName(), // world - MinecraftColor.fromString(args[2]) // color + MinecraftColor.fromString(args[3]) // color ); } diff --git a/ic_plugin/src/main/java/nl/interestingcorner/commands/CoordinatesCommand.java b/ic_plugin/src/main/java/nl/interestingcorner/commands/CoordinatesCommand.java index cee7cdf..feda2b2 100644 --- a/ic_plugin/src/main/java/nl/interestingcorner/commands/CoordinatesCommand.java +++ b/ic_plugin/src/main/java/nl/interestingcorner/commands/CoordinatesCommand.java @@ -4,11 +4,20 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; +import net.md_5.bungee.api.chat.TextComponent; + public class CoordinatesCommand implements CommandExecutor{ @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - return switch (label) { + TextComponent textComponent = new TextComponent("Got command " + command.getName() + " label " + label + " and args "); + for (String string : args) { + textComponent.addExtra(string); + } + + sender.sendMessage(textComponent.getText()); + + return switch (args[0]) { case "get" -> new GetCoordinatesCommandHandler().handleCommand(sender, args); case "add" -> new AddCoordinateCommandHandler().handleCommand(sender, args); default -> false; diff --git a/ic_plugin/src/main/resources/plugin.yml b/ic_plugin/src/main/resources/plugin.yml index 40d45fa..45b73dc 100644 --- a/ic_plugin/src/main/resources/plugin.yml +++ b/ic_plugin/src/main/resources/plugin.yml @@ -5,4 +5,4 @@ version: 0.1 commands: ic-coords: description: Main command for the coordinates - usage: /ic-coords get|add \ No newline at end of file + usage: /ic-coords get | add \ No newline at end of file