From b33315fabcf3a5fd32b54074665b4f0b4669cd13 Mon Sep 17 00:00:00 2001 From: Daniel McCoy Stephenson Date: Mon, 24 Aug 2026 01:09:34 -0600 Subject: [PATCH] Declare command metadata and permission, and stop /fly falling through to usage Adds a permissions block to plugin.yml declaring FlyCommand.fly with default op, plus description and usage metadata for the Fly command, so the manifest matches what USER_GUIDE.md, COMMANDS.md and Main.java already claim. Returning true from the permission-denied branch of onCommand is part of the same change rather than a separate one: with a usage string now declared, falling through to the trailing return false would newly print that usage line underneath the plugin's own permission alert. Adds @Override to onCommand, matching onEnable and onDisable. Closes #5 Closes #6 Closes #7 Co-Authored-By: Claude Opus 5 (1M context) --- CHANGELOG.md | 6 ++++++ me/Daniel/FlyCommand/Main.java | 2 ++ plugin.yml | 9 ++++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d500cff..1c2bc45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Added - `README.md` describing the plugin, its installation, its documentation, and how it is built and validated by hand. +- `description` and `usage` metadata for the `Fly` command in `plugin.yml`. +- A `permissions` block in `plugin.yml` declaring `FlyCommand.fly` with default `op`, matching the permission table in `USER_GUIDE.md`. + +### Fixed +- The permission-denied branch of `/fly` now returns `true`, so the plugin's own alert is the only message a player without `FlyCommand.fly` is shown. +- `onCommand` now carries the `@Override` annotation, matching `onEnable` and `onDisable`. ## [1.0] diff --git a/me/Daniel/FlyCommand/Main.java b/me/Daniel/FlyCommand/Main.java index 8f3eaa4..56a4736 100644 --- a/me/Daniel/FlyCommand/Main.java +++ b/me/Daniel/FlyCommand/Main.java @@ -17,6 +17,7 @@ public void onDisable() { } + @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if (label.equalsIgnoreCase("fly")) { if (!(sender instanceof Player)) { @@ -32,6 +33,7 @@ public boolean onCommand(CommandSender sender, Command command, String label, St } else { player.sendMessage("Alert: Permission 'FlyCommand.fly' required."); + return true; } } } diff --git a/plugin.yml b/plugin.yml index 282cbc0..1c31cd2 100644 --- a/plugin.yml +++ b/plugin.yml @@ -4,4 +4,11 @@ version: 1.0 api-version: 1.13 commands: - Fly: \ No newline at end of file + Fly: + description: Toggles flight mode on or off for the executing player. + usage: / + +permissions: + FlyCommand.fly: + description: Allows the player to toggle flight. + default: op