-
-
Notifications
You must be signed in to change notification settings - Fork 242
feat(velocity): document velocity-plugin.json file #735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Strokkur424
wants to merge
7
commits into
main
Choose a base branch
from
feat/velocity-plugin-json
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+131
−2
Open
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
cecc7e0
feat(velocity): document velocity-plugin.json file
Strokkur424 efc739c
fix: remove version dependency field
Strokkur424 673a763
Merge branch 'main' into feat/velocity-plugin-json
Strokkur424 abf6277
feat: add name/id documentation, made example use all fields, replace…
Strokkur424 958afa4
chore: fix incorrect aside identifier
Strokkur424 2455466
chore: remove []
Strokkur424 fbc45ca
chore: replace comments with line markers from EC
Strokkur424 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
src/content/docs/velocity/dev/getting-started/velocity-plugin-json.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| --- | ||
| title: The Velocity plugin file | ||
| description: A full reference of the velocity-plugin.json file. | ||
| slug: velocity/dev/velocity-plugin-json | ||
| --- | ||
|
|
||
| import { FileTree } from "@astrojs/starlight/components"; | ||
|
|
||
| The `velocity-plugin.json` file is the configuration file for your plugin. It contains information | ||
| about your plugin's name, description, version, main class path, and other. | ||
|
|
||
| The `velocity-plugin.json` file is located in the `resources` directory of your plugin. It is generated | ||
| automatically if you configured the Velocity annotation processor and used the `@Plugin` annotation. | ||
|
|
||
| <FileTree> | ||
| - velocity-plugin/ | ||
| - src/ | ||
| - main/ | ||
| - java/ | ||
| - resources/ | ||
| - **velocity-plugin.json** | ||
| - build.gradle.kts | ||
| - settings.gradle.kts | ||
| </FileTree> | ||
|
|
||
| ## Example | ||
| This is an example `velocity-plugin.json` file: | ||
|
|
||
| ```json title=velocity-plugin.json | ||
| { | ||
| "id": "example-plugin", | ||
| "name": "Velocity Example Plugin", | ||
| "version": "1.0.0", | ||
| "description": "An example plugin for showcasing the plugin json file.", | ||
| "main": "com.velocitypowered.testplugin.TestPluginMain" | ||
| } | ||
| ``` | ||
|
|
||
| ## Fields | ||
| The only required fields are `id` and `main`. Any other fields are optional. | ||
|
|
||
| ### id | ||
| The ID of the plugin. This ID needs to be unique for each plugin. | ||
| - `"id": "a_cool_plugin"` | ||
|
|
||
| Plugin IDs must start with a lowercase letter and may contain lowercase letters, | ||
| digits, hyphens, and underscores. The total length must not exceed 64 characters. | ||
|
|
||
| ### main | ||
| The path towards your main plugin class. | ||
| - `"main": "com.example.yourplugin.PluginMain"` | ||
|
|
||
| ### name | ||
| A user-friendly variant of your plugin's name. | ||
| - `"name": "A cool plugin"` | ||
|
|
||
| ### version | ||
| The version of your plugin. | ||
| - `"version": "0.0.1-beta.7"` | ||
|
|
||
| ### description | ||
| The description of your plugin. | ||
| - `"description": "Some interesting plugin description."` | ||
|
|
||
| ### url | ||
| The URL of your plugin's website. | ||
| - `"url": "https://github.com/PaperMC/Velocity"` | ||
|
|
||
| ### authors | ||
| A list of your plugin's authors. | ||
| - `"authors": ["Strokkur24", "electronicboy"]` | ||
|
|
||
| ### dependencies | ||
| Your plugin's dependencies. The value of this field is an array of dependency objects. | ||
|
|
||
| The dependency object itself has three fields: | ||
| - `id` the plugin ID of the plugin you depend upon | ||
| - `version` the version of your dependency. This field is not required. | ||
| - `optional` whether the dependency is optional. This field is not required. Defaults to `false`. | ||
|
|
||
| ```json | ||
| { | ||
| "dependencies": [ | ||
| { | ||
| "id": "luckperms", | ||
| "optional": true | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.