Skip to content

Commit e849864

Browse files
committed
Internal: Reformat docs
1 parent 8969f33 commit e849864

3 files changed

Lines changed: 73 additions & 53 deletions

File tree

‎README.md‎

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,22 @@
22
PaperExamplePlugin
33
</h1>
44

5-
A template repository for creating Paper (Minecraft) plugins with Kotlin. It comes with an auto-registration system for commands, listeners, permissions, and GUIs — just extend a base class, drop it in the right package, and the plugin handles the rest.
5+
A template repository for creating Paper (Minecraft) plugins with Kotlin. It comes with an auto-registration system for
6+
commands, listeners, permissions, and GUIs — just extend a base class, drop it in the right package, and the plugin
7+
handles the rest.
68

79
## Getting Started
810

911
1. Click **"Use this template"** on GitHub to create your own repository.
1012
2. Replace the placeholder values below with your own:
1113

12-
| Placeholder | File(s) | Description |
13-
|:-----------------------|:-----------------------------------------------------------|:-------------------------------------|
14-
| `ExamplePlugin` | `settings.gradle.kts`, `plugin.yml`, source files, docs | Your plugin's display name |
15-
| `exampleplugin` | `plugin.yml`, source files, docs | Lowercase plugin name (used for commands) |
16-
| `ep` | `plugin.yml`, `CommandRegistrar.kt` | Short command alias |
17-
| `com.example` | `build.gradle.kts` | Your Maven group ID |
18-
| `com.example.exampleplugin` | All source files under `src/main/kotlin/`, `plugin.yml`, docs | Your full base package path |
14+
| Placeholder | File(s) | Description |
15+
|:----------------------------|:--------------------------------------------------------------|:------------------------------------------|
16+
| `ExamplePlugin` | `settings.gradle.kts`, `plugin.yml`, source files, docs | Your plugin's display name |
17+
| `exampleplugin` | `plugin.yml`, source files, docs | Lowercase plugin name (used for commands) |
18+
| `ep` | `plugin.yml`, `CommandRegistrar.kt` | Short command alias |
19+
| `com.example` | `build.gradle.kts` | Your Maven group ID |
20+
| `com.example.exampleplugin` | All source files under `src/main/kotlin/`, `plugin.yml`, docs | Your full base package path |
1921

2022
3. Rename the source directory `src/main/kotlin/com/example/exampleplugin/` to match your package.
2123
4. Update the `FUNDING.yml` with your own sponsorship links (or remove it).
@@ -31,5 +33,6 @@ src/main/kotlin/com/example/exampleplugin/
3133
└── registration/ # Auto-registration framework
3234
```
3335

34-
See [`docs/DEVELOPER_GUIDE.md`](docs/DEVELOPER_GUIDE.md) for detailed instructions on creating commands, listeners, and GUIs.
36+
See [`docs/DEVELOPER_GUIDE.md`](docs/DEVELOPER_GUIDE.md) for detailed instructions on creating commands, listeners, and
37+
GUIs.
3538

‎docs/COMMIT_STRUCTURE.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# ExamplePlugin - Commit Structure
22

3-
To maintain a clean and organized codebase, all developers must follow the standardized commit message format. This ensures that changes to features are easy to track.
3+
To maintain a clean and organized codebase, all developers must follow the standardized commit message format. This
4+
ensures that changes to features are easy to track.
45

56
## Basic Structure
7+
68
Every commit message must follow this syntax:
79
`<tag>: <message>`
810

@@ -18,6 +20,7 @@ Every commit message must follow this syntax:
1820
| **Update** | Plugin version changes. | `Update: 1.0.0 release` |
1921

2022
## Best Practices
23+
2124
* **Use Present Tense:** Write "Add feature" instead of "Added feature."
2225
* **Be Specific:** Instead of `Fix: bug`, use `Fix: Handle undefined member in /role command`.
2326
* **No Period at End:** Do not end the commit message with a period.

‎docs/DEVELOPER_GUIDE.md‎

Lines changed: 57 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
# ExamplePlugin - Developer Guide
22

3-
This guide explains how to create **commands**, **listeners**, and **GUIs** using ExamplePlugin's registration system. All three follow the same pattern: extend a base class (or implement an interface), place the file in the correct package, and the plugin handles the rest automatically at startup.
3+
This guide explains how to create **commands**, **listeners**, and **GUIs** using ExamplePlugin's registration system.
4+
All three follow the same pattern: extend a base class (or implement an interface), place the file in the correct
5+
package, and the plugin handles the rest automatically at startup.
46

57
## How Auto-Registration Works
68

7-
ExamplePlugin uses a `PackageScanner` to discover classes at runtime. When the plugin starts, it scans specific packages for concrete (non-abstract) classes and registers them automatically. You never need to edit `plugin.yml` or manually wire anything up.
9+
ExamplePlugin uses a `PackageScanner` to discover classes at runtime. When the plugin starts, it scans specific packages
10+
for concrete (non-abstract) classes and registers them automatically. You never need to edit `plugin.yml` or manually
11+
wire anything up.
812

9-
| System | Base Class / Interface | Package |
10-
|:------------|:-----------------------|:-------------------------------------------------|
11-
| Commands | `PluginCommand` | `com.example.exampleplugin.commands` |
12-
| Permissions | *(derived from commands)* | *(automatic — no package needed)* |
13-
| Listeners | `Listener` | `com.example.exampleplugin.listeners` |
14-
| GUIs | `PluginGUI` | `com.example.exampleplugin.guis` |
13+
| System | Base Class / Interface | Package |
14+
|:------------|:--------------------------|:--------------------------------------|
15+
| Commands | `PluginCommand` | `com.example.exampleplugin.commands` |
16+
| Permissions | *(derived from commands)* | *(automatic — no package needed)* |
17+
| Listeners | `Listener` | `com.example.exampleplugin.listeners` |
18+
| GUIs | `PluginGUI` | `com.example.exampleplugin.guis` |
1519

16-
Subpackages are also scanned, so you can freely organize classes into folders like `commands/game/`, `listeners/player/`, or `guis/menus/`.
20+
Subpackages are also scanned, so you can freely organize classes into folders like `commands/game/`,
21+
`listeners/player/`, or `guis/menus/`.
1722

1823
## Constructor Requirements
1924

@@ -32,52 +37,59 @@ The plugin instance is injected automatically when a `JavaPlugin` constructor is
3237

3338
To create a command, extend `PluginCommand` and place the class anywhere inside the `commands` package or a subpackage.
3439

35-
By default every command is registered as a **sub-command** of `/exampleplugin` (alias `/ep`). For example, a command with `name = "reload"` becomes `/exampleplugin reload`. Set `isMainCommand = true` to register the command as a standalone top-level command instead.
40+
By default every command is registered as a **sub-command** of `/exampleplugin` (alias `/ep`). For example, a command
41+
with `name = "reload"` becomes `/exampleplugin reload`. Set `isMainCommand = true` to register the command as a
42+
standalone top-level command instead.
3643

3744
When a player types `/exampleplugin` in-game, tab-completion automatically lists all available sub-commands.
3845

3946
### Categories
4047

41-
Commands are automatically categorised based on their **subpackage** (folder) inside the `commands` package. The category is used by the built-in `/exampleplugin help` command to group commands for display.
48+
Commands are automatically categorised based on their **subpackage** (folder) inside the `commands` package. The
49+
category is used by the built-in `/exampleplugin help` command to group commands for display.
4250

43-
| Command Location | Category |
44-
|:---------------------------------------|:------------|
45-
| `commands/PingCommand.kt` | General |
46-
| `commands/game/StartCommand.kt` | Game |
47-
| `commands/admin/BanCommand.kt` | Admin |
51+
| Command Location | Category |
52+
|:--------------------------------|:---------|
53+
| `commands/PingCommand.kt` | General |
54+
| `commands/game/StartCommand.kt` | Game |
55+
| `commands/admin/BanCommand.kt` | Admin |
4856

4957
### Help Command
5058

51-
The plugin ships with a built-in `/exampleplugin help` command. It lists every registered command grouped by category, sorted alphabetically within each group, and formatted with colours for readability. Every command should provide a meaningful `description` so the help output is informative.
59+
The plugin ships with a built-in `/exampleplugin help` command. It lists every registered command grouped by category,
60+
sorted alphabetically within each group, and formatted with colours for readability. Every command should provide a
61+
meaningful `description` so the help output is informative.
5262

5363
### PluginCommand Properties
5464

55-
| Property | Type | Default | Description |
56-
|:----------------|:---------------|:---------------|:----------------------------------------------------------------------------|
57-
| `name` | `String` | *(required)* | The command name (e.g. `"reload"` for `/exampleplugin reload`) |
58-
| `description` | `String` | `""` | A brief description shown in `/exampleplugin help` — always provide one |
59-
| `usage` | `String` | `"/<command>"` | Usage hint shown when the command fails |
60-
| `aliases` | `List<String>` | `emptyList()` | Alternative names for the command (applicable to main commands only) |
61-
| `permission` | `String?` | `null` | Permission node required to use the command (auto-registered at startup) |
62-
| `isMainCommand` | `Boolean` | `false` | When `true`, the command is registered as a standalone top-level command |
65+
| Property | Type | Default | Description |
66+
|:----------------|:---------------|:---------------|:-------------------------------------------------------------------------|
67+
| `name` | `String` | *(required)* | The command name (e.g. `"reload"` for `/exampleplugin reload`) |
68+
| `description` | `String` | `""` | A brief description shown in `/exampleplugin help` — always provide one |
69+
| `usage` | `String` | `"/<command>"` | Usage hint shown when the command fails |
70+
| `aliases` | `List<String>` | `emptyList()` | Alternative names for the command (applicable to main commands only) |
71+
| `permission` | `String?` | `null` | Permission node required to use the command (auto-registered at startup) |
72+
| `isMainCommand` | `Boolean` | `false` | When `true`, the command is registered as a standalone top-level command |
6373

6474
### Automatic Permission Registration
6575

66-
When the plugin starts, the `PermissionRegistrar` scans every registered command for a non-null `permission` value and automatically registers it with Bukkit's `PluginManager`. This means:
76+
When the plugin starts, the `PermissionRegistrar` scans every registered command for a non-null `permission` value and
77+
automatically registers it with Bukkit's `PluginManager`. This means:
6778

6879
* Permissions are visible to permission-management plugins (e.g. LuckPerms) without manual configuration.
6980
* Each permission defaults to `PermissionDefault.OP` — only operators have it unless explicitly granted.
7081
* The command's `description` is used as the permission description.
7182
* Duplicate permissions (already registered by another source) are detected and skipped.
7283

73-
You do **not** need to declare permissions in `plugin.yml`; simply set the `permission` property on your command and the system handles the rest.
84+
You do **not** need to declare permissions in `plugin.yml`; simply set the `permission` property on your command and the
85+
system handles the rest.
7486

7587
### Methods to Override
7688

77-
| Method | Required | Description |
78-
|:--------------|:---------|:--------------------------------------------------|
79-
| `execute` | Yes | Called when a player or console runs the command |
80-
| `tabComplete` | No | Called when tab-completion is requested |
89+
| Method | Required | Description |
90+
|:--------------|:---------|:-------------------------------------------------|
91+
| `execute` | Yes | Called when a player or console runs the command |
92+
| `tabComplete` | No | Called when tab-completion is requested |
8193

8294
### Example (Sub-Command)
8395

@@ -196,7 +208,8 @@ class GlobalToolCommand : PluginCommand(
196208

197209
## Listeners
198210

199-
To create a listener, implement Bukkit's `Listener` interface and place the class anywhere inside the `listeners` package or a subpackage.
211+
To create a listener, implement Bukkit's `Listener` interface and place the class anywhere inside the `listeners`
212+
package or a subpackage.
200213

201214
### Methods
202215

@@ -245,23 +258,24 @@ class DeathListener(private val plugin: JavaPlugin) : Listener {
245258

246259
## GUIs
247260

248-
To create a GUI (chest-based inventory menu), extend `PluginGUI` and place the class anywhere inside the `guis` package or a subpackage.
261+
To create a GUI (chest-based inventory menu), extend `PluginGUI` and place the class anywhere inside the `guis` package
262+
or a subpackage.
249263

250264
### PluginGUI Properties
251265

252-
| Property | Type | Default | Description |
253-
|:---------|:---------|:-------------|:----------------------------------------|
254-
| `id` | `String` | *(required)* | Unique identifier used to open the GUI |
255-
| `title` | `String` | *(required)* | Title displayed at the top of the chest |
256-
| `rows` | `Int` | `3` | Number of rows (1–6, each row = 9 slots)|
266+
| Property | Type | Default | Description |
267+
|:---------|:---------|:-------------|:-----------------------------------------|
268+
| `id` | `String` | *(required)* | Unique identifier used to open the GUI |
269+
| `title` | `String` | *(required)* | Title displayed at the top of the chest |
270+
| `rows` | `Int` | `3` | Number of rows (1–6, each row = 9 slots) |
257271

258272
### Methods to Override
259273

260-
| Method | Required | Description |
261-
|:----------|:---------|:-----------------------------------------------------|
262-
| `setup` | Yes | Populate the inventory with items before it opens |
263-
| `onClick` | No | Handle click events (clicks are cancelled by default)|
264-
| `onClose` | No | Handle cleanup when the GUI is closed |
274+
| Method | Required | Description |
275+
|:----------|:---------|:------------------------------------------------------|
276+
| `setup` | Yes | Populate the inventory with items before it opens |
277+
| `onClick` | No | Handle click events (clicks are cancelled by default) |
278+
| `onClose` | No | Handle cleanup when the GUI is closed |
265279

266280
### Opening a GUI
267281

0 commit comments

Comments
 (0)