|
1 | 1 | # Customizing This Template |
2 | 2 |
|
3 | | -When adapting this template for your own plugin, you'll need to update the following files. |
| 3 | +Use this checklist when turning the template into a plugin. |
4 | 4 |
|
5 | | -### Discord Notifications |
6 | | -This repo allows automatically pushing releases to a Discord webhook. |
| 5 | +## Plugin identity |
7 | 6 |
|
8 | | -To use this Action, you will need to set two GitHub Actions secrets. |
9 | | -- `DISCORD_WEBHOOK_ID` |
10 | | -- `DISCORD_WEBHOOK_TOKEN` |
| 7 | +1. Set `rootProject.name` in `settings.gradle.kts` to the Java entry point class name. |
| 8 | +2. Rename `ExamplePlugin.java`, the `ExamplePlugin` class, and all references to it. The current |
| 9 | + `plugin.yml` build substitution requires this name to match `rootProject.name`. |
| 10 | +3. Set `group` in `build.gradle.kts` to the Java package. |
| 11 | +4. Rename the main and test package directories, declarations, and imports from |
| 12 | + `com.crimsonwarpedcraft.exampleplugin`. |
11 | 13 |
|
12 | | -You can find these values by copying the Discord Webhook URL: |
13 | | -`https://discord.com/api/webhooks/<DISCORD_WEBHOOK_ID>/<DISCORD_WEBHOOK_TOKEN>` |
| 14 | +## Example code |
14 | 15 |
|
15 | | -Optionally, you can also configure `DISCORD_RELEASE_WEBHOOK_ID` and `DISCORD_RELEASE_WEBHOOK_TOKEN` |
16 | | -to send release announcements to a separate channel. |
| 16 | +Replace or remove the example command, permission, config, data store, listener, and tests. Keep |
| 17 | +these parts in sync: |
17 | 18 |
|
18 | | -For more information, see [Discord Message Notify](https://github.com/marketplace/actions/discord-message-notify). |
| 19 | +- Command names and permission checks in Java |
| 20 | +- Permission declarations in `src/main/resources/plugin.yml` |
| 21 | +- Fields in `PluginConfig` and `src/main/resources/config.yml` |
| 22 | +- Main and test code |
19 | 23 |
|
20 | | -### `README.md` |
21 | | -Make this relevant to your project. |
| 24 | +CommandAPI registers commands in Java. Do not add matching entries under `commands:` in |
| 25 | +`plugin.yml`. |
22 | 26 |
|
23 | | -Be sure to replace the badges for build status and Discord. |
| 27 | +## Metadata and build |
24 | 28 |
|
25 | | -### `settings.gradle.kts` |
26 | | -Replace `ExamplePlugin` with the name of your plugin. |
| 29 | +- Update `author`, `description`, `permissions`, and `api-version` in `plugin.yml`. |
| 30 | +- Keep the Paper API version, Java toolchain, CI Java versions, and documented server support in |
| 31 | + sync. |
| 32 | +- Review repositories, dependencies, Shadow relocations, and `minimize` exclusions. Remove |
| 33 | + example dependencies the plugin no longer uses. |
27 | 34 |
|
28 | | -```kotlin |
29 | | -rootProject.name = "ExamplePlugin" |
30 | | -``` |
| 35 | +## Project files |
31 | 36 |
|
32 | | -### `build.gradle.kts` |
33 | | -Make sure to update `group` to your package's name in the following section. |
| 37 | +- Rewrite `README.md` for the plugin. Replace the build badge, Discord link, commands, features, |
| 38 | + and repository links. |
| 39 | +- Update `docs/usage.md`, `docs/releases.md`, `AGENTS.md`, and canonical skills under |
| 40 | + `.agents/skills/` when their examples or architecture change. |
| 41 | +- Do not edit `CLAUDE.md` or `.claude/skills/`. They are generated mirrors. |
| 42 | +- Check source attribution and license terms before changing copyright notices. |
34 | 43 |
|
35 | | -```kotlin |
36 | | -group = "com.crimsonwarpedcraft.exampleplugin" |
37 | | -``` |
| 44 | +## GitHub |
38 | 45 |
|
39 | | -Add any required repositories for your dependencies: |
| 46 | +- Update `.github/CODEOWNERS` and update or delete `.github/FUNDING.yml`. |
| 47 | +- Replace the enforcement contact in `CODE_OF_CONDUCT.md`. |
| 48 | +- Review issue templates, labels, the stale policy, Dependabot, branch protection, and workflows. |
| 49 | +- Update each `main` reference if the repository uses a different default branch. |
40 | 50 |
|
41 | | -```kotlin |
42 | | -repositories { |
43 | | - // ... |
44 | | -} |
45 | | -``` |
| 51 | +Discord notifications use: |
46 | 52 |
|
47 | | -Also, update your dependencies as needed (of course). |
| 53 | +- Repository variable `DISCORD_WEBHOOK_ID` |
| 54 | +- Actions secret `DISCORD_WEBHOOK_TOKEN` |
| 55 | +- Optional repository variable `DISCORD_RELEASE_WEBHOOK_ID` |
| 56 | +- Optional Actions secret `DISCORD_RELEASE_WEBHOOK_TOKEN` |
48 | 57 |
|
49 | | -```kotlin |
50 | | -dependencies { |
51 | | - // ... |
52 | | -} |
53 | | -``` |
| 58 | +Remove the notification jobs if the plugin will not use Discord webhooks. |
54 | 59 |
|
55 | | -### `src/main/resources/plugin.yml` |
56 | | -First, update the following with your information. |
| 60 | +## Verify |
57 | 61 |
|
58 | | -```yaml |
59 | | -author: AUTHOR |
60 | | -description: DESCRIPTION |
61 | | -``` |
62 | | -
|
63 | | -Next, the `permissions` section below should be updated as needed. |
64 | | - |
65 | | -```yaml |
66 | | -permissions: |
67 | | - example.test: |
68 | | - description: DESCRIPTION |
69 | | - default: true |
70 | | - example.*: |
71 | | - description: Grants all other permissions |
72 | | - default: false |
73 | | - children: |
74 | | - example.test: true |
75 | | -``` |
76 | | - |
77 | | -Do NOT create a `commands:` section — CommandAPI registers commands programmatically in |
78 | | -`onEnable()` (see `ExampleCommand`), not via `plugin.yml`. |
79 | | - |
80 | | -Declaring a command in both places |
81 | | -causes Bukkit to register it a second time, which CommandAPI will warn about at startup. |
82 | | - |
83 | | -### `.github/` |
84 | | -- `CODEOWNERS` -> Replace `leviem1` with your username. |
85 | | -- `FUNDING.yml` -> Update or delete this file, [whatever applies to you.](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/displaying-a-sponsor-button-in-your-repository) |
86 | | - |
87 | | -### Code of Conduct |
88 | | -If you choose to adopt the Code of Conduct for your project, |
89 | | -please update line 63 of `CODE_OF_CONDUCT.md` with your preferred contact method. |
| 62 | +1. Search for old names, packages, permissions, placeholders, attribution, and repository URLs. |
| 63 | +2. Run `./gradlew clean build`. |
| 64 | +3. Check the processed `plugin.yml` and shaded JAR for the correct main class. |
| 65 | +4. Start the JAR on the oldest supported Paper version. |
0 commit comments