diff --git a/ic_plugin_coordinates/src/main/java/nl/interestingcorner/coordinates/commands/CoordinatesCommand.java b/ic_plugin_coordinates/src/main/java/nl/interestingcorner/coordinates/commands/CoordinatesCommand.java index 6128293..a45abd5 100644 --- a/ic_plugin_coordinates/src/main/java/nl/interestingcorner/coordinates/commands/CoordinatesCommand.java +++ b/ic_plugin_coordinates/src/main/java/nl/interestingcorner/coordinates/commands/CoordinatesCommand.java @@ -20,6 +20,7 @@ public class CoordinatesCommand implements CommandExecutor{ case "get" -> new GetCoordinatesCommandHandler().handleCommand(sender, args); case "add" -> new AddCoordinateCommandHandler().handleCommand(sender, args); case "map" -> new GetMapCommandHandler().handleCommand(sender, args); + case "help" -> new HelpCommandHandler().handleCommand(sender, args); default -> false; }; } diff --git a/ic_plugin_coordinates/src/main/java/nl/interestingcorner/coordinates/commands/GetMapCommandHandler.java b/ic_plugin_coordinates/src/main/java/nl/interestingcorner/coordinates/commands/GetMapCommandHandler.java index ef8a5cd..75624f6 100644 --- a/ic_plugin_coordinates/src/main/java/nl/interestingcorner/coordinates/commands/GetMapCommandHandler.java +++ b/ic_plugin_coordinates/src/main/java/nl/interestingcorner/coordinates/commands/GetMapCommandHandler.java @@ -12,7 +12,7 @@ import org.bukkit.inventory.meta.ItemMeta; import nl.interestingcorner.core.MinecraftColor; public class GetMapCommandHandler implements CoordinatesCommandHandler { - public static final String MAP_ITEM_NAME = MinecraftColor.LIGHT_PURPLE + "Map of Coordinates"; + public static final String MAP_ITEM_NAME = MinecraftColor.LIGHT_PURPLE.toColorCode() + "Map of Coordinates"; public static final String MAP_ITEM_LORE = MinecraftColor.AQUA.toColorCode() + "This will take you anywhere!"; @Override diff --git a/ic_plugin_coordinates/src/main/java/nl/interestingcorner/coordinates/commands/HelpCommandHandler.java b/ic_plugin_coordinates/src/main/java/nl/interestingcorner/coordinates/commands/HelpCommandHandler.java new file mode 100644 index 0000000..e8ff360 --- /dev/null +++ b/ic_plugin_coordinates/src/main/java/nl/interestingcorner/coordinates/commands/HelpCommandHandler.java @@ -0,0 +1,26 @@ +package nl.interestingcorner.coordinates.commands; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import nl.interestingcorner.core.MinecraftColor; + +public class HelpCommandHandler implements CoordinatesCommandHandler { + + @Override + public boolean handleCommand(CommandSender sender, String[] args) { + if (sender instanceof Player player) { + player.sendMessage(MinecraftColor.LIGHT_PURPLE.toColorCode() + "IC-Coords plugin commands:"); + player.sendMessage(MinecraftColor.AQUA.toColorCode() + "/ic-coords map" + MinecraftColor.WHITE.toColorCode() + " - Get a special map that you can use to teleport between coordinates"); + player.sendMessage(MinecraftColor.AQUA.toColorCode() + "/ic-coords get [world]" + MinecraftColor.WHITE.toColorCode() + " - Show all coordinates. Add a world name to filter by world."); + player.sendMessage(MinecraftColor.AQUA.toColorCode() + "/ic-coords add [color]" + MinecraftColor.WHITE.toColorCode() + " - Add a new coordinate at you current location with a name, description, and color. If no color is specified, the color will be white"); + player.sendMessage(MinecraftColor.AQUA.toColorCode() + "/ic-coords help" + MinecraftColor.WHITE.toColorCode() + " - Show this help message"); + + return true; + } else { + sender.sendMessage("This command can only be used by a player."); + return false; + } + } + +} diff --git a/ic_plugin_coordinates/src/main/resources/plugin.yml b/ic_plugin_coordinates/src/main/resources/plugin.yml index 22d5693..ccb6dbd 100644 --- a/ic_plugin_coordinates/src/main/resources/plugin.yml +++ b/ic_plugin_coordinates/src/main/resources/plugin.yml @@ -7,4 +7,4 @@ depend: [IC-core] commands: ic-coords: description: Main command for the coordinates - usage: /ic-coords get | add | map \ No newline at end of file + usage: /ic-coords get | add | map | help. To add a command, use /ic-coords add "name" "description" . \ No newline at end of file