Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
2 changes: 2 additions & 0 deletions me/Daniel/FlyCommand/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -32,6 +33,7 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
}
else {
player.sendMessage("Alert: Permission 'FlyCommand.fly' required.");
return true;
}
}
}
Expand Down
9 changes: 8 additions & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,11 @@ version: 1.0
api-version: 1.13

commands:
Fly:
Fly:
description: Toggles flight mode on or off for the executing player.
usage: /<command>

permissions:
FlyCommand.fly:
description: Allows the player to toggle flight.
default: op
Loading