mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2024-11-13 23:26:48 +01:00
Merge pull request #522 from PlaceholderAPI/master
Update docs/wiki from master
This commit is contained in:
commit
d4744838ee
101
.github/CONTRIBUTING.md
vendored
101
.github/CONTRIBUTING.md
vendored
@ -1,64 +1,51 @@
|
|||||||
[issue]: https://github.com/PlaceholderAPI/PlaceholderAPI/issues/new?template=change_request_placeholderapi.md
|
[issue]: https://github.com/PlaceholderAPI/PlaceholderAPI/issues/new
|
||||||
[Discord]: https://helpch.at/discord
|
[discord]: https://helpch.at/discord
|
||||||
[homepage]: http://contributor-covenant.org
|
[code of conduct]: https://github.com/PlaceholderAPI/PlaceholderAPI/blob/master/CODE_OF_CONDUCT.md
|
||||||
[version]: http://contributor-covenant.org/version/1/4/
|
[wiki]: https://github.com/PlaceholderAPI/PlaceholderAPI/blob/master/wiki
|
||||||
|
[style]: https://github.com/PlaceholderAPI/PlaceholderAPI/tree/master/config/style
|
||||||
|
|
||||||
# Contributing
|
# Contributing Guidelines
|
||||||
|
We welcome everyone to contribute towards the PlaceholderAPI Project, but doing so will require you to follow specific rules to keep a consistent and welcoming way of contributing.
|
||||||
|
|
||||||
When contributing to this repository, please first discuss the change you wish to make via [issue] or through [Discord] with the owners of this repository before making a change.
|
If you have any questions about contributions towards the project, feel free to contact us on our [Discord Server][discord].
|
||||||
|
|
||||||
Please note we have a code of conduct, please follow it in all your interactions with the project.
|
## Issues
|
||||||
|
Like any other project can you encounter bugs or a feature is missing for you in the plugin.
|
||||||
|
For that, you can open an [issue] to report a bug, or suggest a new feature to be added.
|
||||||
|
|
||||||
## Pull Request Process
|
When doing so, make sure you follow rules below:
|
||||||
|
|
||||||
1. Update the README.md with details of changes if it is affected by those changes.
|
### Follow the template
|
||||||
2. Try to prevent any breaking changes affecting the end-user (Developers using the API).
|
We have issue templates to help us get the required information more easily. Please follow the provided template when either filing a bug report or feature request.
|
||||||
Mention any breaking changes that could affect the end-user.
|
Your issue may be closed without warning for not following the template.
|
||||||
3. Document any public methods that the end-user might use.
|
|
||||||
|
### Use the latest version
|
||||||
|
When it comes to bug reports should you always check first, that you're using the latest release of PlaceholderAPI.
|
||||||
|
Often the bug you've encountered, is fixed in a newer version.
|
||||||
|
|
||||||
|
The same rules apply when making a feature request.
|
||||||
|
|
||||||
|
### No duplicate issue
|
||||||
|
Make sure that there aren't any existing issues relating to the problem, which are still open, or are closed with a solution/explanation.
|
||||||
|
Opening a separate issue for a bug report or feature request, that already exists on the issue tracker only slows down the process of fixing the bug or implementing the feature.
|
||||||
|
|
||||||
|
If an issue with the bug or feature you want to report/suggest exists, comment on it with your info (bug reports) or give it a :thumbsup: (Feature Request) to show that this is important for you.
|
||||||
|
|
||||||
|
### Issue isn't caused by external source
|
||||||
|
PlaceholderAPI provides a feature to have expansions (separate jar files) for placeholders. This gives it a possability that an issue you encounter is caused by said expansions or a separate plugin that uses those expansions.
|
||||||
|
In those cases should you report the issue to the issue tracker of the expansion or plugin.
|
||||||
|
|
||||||
|
## Pull requests
|
||||||
|
As an open source project are we welcoming all contributions to improve PlaceholderAPI, being it changes to its code like bug fixes or new features, or contributions to its documentation such as the [Wiki] or the Javadoc.
|
||||||
|
|
||||||
|
### Code contributions
|
||||||
|
Any contributions to PlaceholderAPI's code should be done towards the `develop` branch. Targeting the `master` branch in your Pull request may get it closed without warning.
|
||||||
|
Additionally should you follow the project's codestyle which you can find in the [`config/style`][style] directory.
|
||||||
|
|
||||||
|
### Wiki/Javadoc contributions
|
||||||
|
If your pull request only targets the [wiki] or only changes the javadoc comments of PlaceholderAPI (And not its actual code), it should be to `docs/wiki` branch.
|
||||||
|
The develop branch should only be targeted when you also change some of PlaceholderAPI's code.
|
||||||
|
|
||||||
## Code of Conduct
|
## Code of Conduct
|
||||||
|
We have a [Code of Conduct] to maintain a welcoming atmosphere in this project.
|
||||||
### Our Pledge
|
If your contributions go against the Code of Conduct, linked above, we reserve the right to deny or revert your contributions.
|
||||||
|
|
||||||
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
|
||||||
|
|
||||||
### Our Standards
|
|
||||||
|
|
||||||
Examples of behavior that contributes to creating a positive environment
|
|
||||||
include:
|
|
||||||
|
|
||||||
* Using welcoming and inclusive language
|
|
||||||
* Being respectful of differing viewpoints and experiences
|
|
||||||
* Gracefully accepting constructive criticism
|
|
||||||
* Focusing on what is best for the community
|
|
||||||
* Showing empathy towards other community members
|
|
||||||
|
|
||||||
Examples of unacceptable behavior by participants include:
|
|
||||||
|
|
||||||
* The use of sexualized language or imagery and unwelcome sexual attention or advances
|
|
||||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
|
||||||
* Public or private harassment
|
|
||||||
* Publishing others' private information, such as a physical or electronic address, without explicit permission
|
|
||||||
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
|
||||||
|
|
||||||
### Our Responsibilities
|
|
||||||
|
|
||||||
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
|
||||||
|
|
||||||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
|
||||||
|
|
||||||
### Scope
|
|
||||||
|
|
||||||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
|
||||||
|
|
||||||
### Enforcement
|
|
||||||
|
|
||||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at our [Discord]. All
|
|
||||||
complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
|
||||||
|
|
||||||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
|
||||||
|
|
||||||
### Attribution
|
|
||||||
|
|
||||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
|
||||||
available at [http://contributor-covenant.org/version/1/4][version]
|
|
||||||
|
3
.github/ISSUE_TEMPLATE/config.yml
vendored
3
.github/ISSUE_TEMPLATE/config.yml
vendored
@ -12,3 +12,6 @@ contact_links:
|
|||||||
- name: Update Wiki
|
- name: Update Wiki
|
||||||
url: https://github.com/PlaceholderAPI/PlaceholderAPI/pulls
|
url: https://github.com/PlaceholderAPI/PlaceholderAPI/pulls
|
||||||
about: Please make a Pull request towards the "wiki" folder to update the wiki.
|
about: Please make a Pull request towards the "wiki" folder to update the wiki.
|
||||||
|
- name: Questions
|
||||||
|
url: https://github.com/PlaceholderAPI/PlaceholderAPI/discussions
|
||||||
|
about: If you have any questions, ask them in our Discussions Page.
|
||||||
|
63
.github/label-commenter-config.yml
vendored
63
.github/label-commenter-config.yml
vendored
@ -1,16 +1,22 @@
|
|||||||
|
comment:
|
||||||
|
footer: "\
|
||||||
|
----\n\n
|
||||||
|
> *This is an automated response created by a **GitHub Action***\n
|
||||||
|
> *Mentioning the bot won't have any effect!*
|
||||||
|
"
|
||||||
|
|
||||||
labels:
|
labels:
|
||||||
- name: 'Type: Issue (Expansion)'
|
- name: 'Type: Issue (Expansion)'
|
||||||
labeled:
|
labeled:
|
||||||
issue:
|
issue:
|
||||||
body: |-
|
body: |-
|
||||||
Hello @{{ sender.login }},
|
Hello @{{ issue.user.login }},
|
||||||
|
|
||||||
The issue you encountered is caused by an Expansion and not PlaceholderAPI itself.
|
The issue you encountered is caused by an Expansion and not PlaceholderAPI itself.
|
||||||
This issue-tracker is reserved for Bug reports and feature requests towards PlaceholderAPI.
|
This issue-tracker is reserved for Bug reports and feature requests towards PlaceholderAPI.
|
||||||
|
|
||||||
Please report this issue to the Expansion's main issue-tracker.
|
Please report this issue to the Expansion's main issue-tracker.
|
||||||
|
action: close
|
||||||
> *This is an automated response created by a GitHub-Action. Responding to or mentioning this bot has no effect!*
|
|
||||||
- name: 'Type: Duplicate'
|
- name: 'Type: Duplicate'
|
||||||
labeled:
|
labeled:
|
||||||
issue:
|
issue:
|
||||||
@ -18,14 +24,12 @@ labels:
|
|||||||
Your issue is already known and a separate issue with the exact same report/feature request already exist.
|
Your issue is already known and a separate issue with the exact same report/feature request already exist.
|
||||||
|
|
||||||
Please comment on the already existing issue with your information instead of opening your own.
|
Please comment on the already existing issue with your information instead of opening your own.
|
||||||
|
|
||||||
> *This is an automated response created by a GitHub-Action. Responding to or mentioning this bot has no effect!*
|
|
||||||
action: close
|
action: close
|
||||||
- name: 'Problem: More info required'
|
- name: 'Problem: More info required'
|
||||||
labeled:
|
labeled:
|
||||||
issue:
|
issue:
|
||||||
body: |-
|
body: |-
|
||||||
Hello @{{ sender.login }},
|
Hello @{{ issue.user.login }},
|
||||||
|
|
||||||
Your issue unfortunately lacks certain information that we require in order to help you with your issue.
|
Your issue unfortunately lacks certain information that we require in order to help you with your issue.
|
||||||
Please make sure you provide the following information:
|
Please make sure you provide the following information:
|
||||||
@ -34,16 +38,12 @@ labels:
|
|||||||
- Currently installed Expansions
|
- Currently installed Expansions
|
||||||
- Currently installed Plugins
|
- Currently installed Plugins
|
||||||
|
|
||||||
The easiest way to provide those information is through the `/papi dumb` command which posts the required information and gives a URL to share.
|
The easiest way to provide those information is through the `/papi dumb` command which posts the required information to https://paste.helpch.at and gives a URL to share.
|
||||||
|
|
||||||
> *This is an automated response created by a GitHub-Action. Responding to or mentioning this bot has no effect!*
|
|
||||||
unlabeled:
|
unlabeled:
|
||||||
issue:
|
issue:
|
||||||
body: |-
|
body: |-
|
||||||
Thank you for providing additional information.
|
Thank you for providing additional information.
|
||||||
We will take a look at the issue you encounter and come back to you with a possible solution.
|
We will take a look at the issue you encounter and come back to you with a possible solution.
|
||||||
|
|
||||||
> *This is an automated response created by a GitHub-Action. Responding to or mentioning this bot has no effect!*
|
|
||||||
- name: 'Type: Invalid'
|
- name: 'Type: Invalid'
|
||||||
labeled:
|
labeled:
|
||||||
issue:
|
issue:
|
||||||
@ -60,13 +60,14 @@ labels:
|
|||||||
If you want changes to be made towards the Wiki, would we encourage you to [Make a Pull request](https://github.com/PlaceholderAPI/PlaceholderAPI/pulls).
|
If you want changes to be made towards the Wiki, would we encourage you to [Make a Pull request](https://github.com/PlaceholderAPI/PlaceholderAPI/pulls).
|
||||||
You can find more information about this process on the [Wiki's Readme](https://github.com/PlaceholderAPI/PlaceholderAPI/blob/master/wiki/README.md).
|
You can find more information about this process on the [Wiki's Readme](https://github.com/PlaceholderAPI/PlaceholderAPI/blob/master/wiki/README.md).
|
||||||
|
|
||||||
> *This is an automated response created by a GitHub-Action. Responding to or mentioning this bot has no effect!*
|
It is recommended to [join our Discord Server](https://helpch.at/discord) as you often receive faster response compared to the issue tracker here.
|
||||||
|
Questions about PlaceholderAPI should be asked in our [Discussions](https://github.com/PlaceholderAPI/PlaceholderAPI/discussions).
|
||||||
action: close
|
action: close
|
||||||
- name: 'Target: Wiki'
|
- name: 'Target: Wiki'
|
||||||
labeled:
|
labeled:
|
||||||
issue:
|
issue:
|
||||||
body: |-
|
body: |-
|
||||||
Hello @{{ sender.login }},
|
Hello @{{ issue.user.login }},
|
||||||
|
|
||||||
Thank you for reaching out to us about the wiki.
|
Thank you for reaching out to us about the wiki.
|
||||||
We would like to inform you, that you are now able to directly commit your changes to the wiki through a Pull request.
|
We would like to inform you, that you are now able to directly commit your changes to the wiki through a Pull request.
|
||||||
@ -77,8 +78,6 @@ labels:
|
|||||||
- You followed the general Styling Guidelines mentioned in the wiki's [README](https://github.com/PlaceholderAPI/PlaceholderAPI/blob/docs/wiki/wiki/README.md) file.
|
- You followed the general Styling Guidelines mentioned in the wiki's [README](https://github.com/PlaceholderAPI/PlaceholderAPI/blob/docs/wiki/wiki/README.md) file.
|
||||||
|
|
||||||
If you have any questions about submitting a PR for the wiki or have any other questions don't hesitate to ask us about it.
|
If you have any questions about submitting a PR for the wiki or have any other questions don't hesitate to ask us about it.
|
||||||
|
|
||||||
> *This is an automated response created by a GitHub-Action. Responding to or mentioning this bot has no effect!*
|
|
||||||
- name: 'Type: Not a bug'
|
- name: 'Type: Not a bug'
|
||||||
labeled:
|
labeled:
|
||||||
issue:
|
issue:
|
||||||
@ -88,13 +87,35 @@ labels:
|
|||||||
|
|
||||||
Before providing more info, always make sure to use the latest version of PlaceholderAPI, as the issue you encounter might already be fixed in a newer version.
|
Before providing more info, always make sure to use the latest version of PlaceholderAPI, as the issue you encounter might already be fixed in a newer version.
|
||||||
Optionally can you also try out [development builds](https://ci.extendedclip.com/job/PlaceholderAPI/) and see if the issue was fixed there.
|
Optionally can you also try out [development builds](https://ci.extendedclip.com/job/PlaceholderAPI/) and see if the issue was fixed there.
|
||||||
|
|
||||||
> *This is an automated response created by a GitHub-Action. Responding to or mentioning this bot has no effect!*
|
|
||||||
action: close
|
action: close
|
||||||
unlabeled:
|
unlabeled:
|
||||||
issue:
|
issue:
|
||||||
body: |-
|
body: After further investigation is the issue you encounter indeed considered a bug and we will try to fix it as soon as possible.
|
||||||
After further investigation is the issue you encounter indeed considered a bug and we will try to fix it as soon as possible.
|
|
||||||
|
|
||||||
> *This is an automated response created by a GitHub-Action. Responding to or mentioning this bot has no effect!*
|
|
||||||
action: open
|
action: open
|
||||||
|
- name: 'Status: Inactive'
|
||||||
|
labeled:
|
||||||
|
issue:
|
||||||
|
body: |-
|
||||||
|
The issue was marked as "inactive" which means it didn't recieve any responses from the Author ({{ issue.user.login }}) for a long period of time.
|
||||||
|
To keep the issue-tracker clean and up to date are we closing issues, that didn't receive any responses for a long time.
|
||||||
|
|
||||||
|
If you're the Author and this issue is still present, make sure to respond with extra info and **do not create a new issue for the same problem!**
|
||||||
|
action: close
|
||||||
|
unlabeled:
|
||||||
|
issue:
|
||||||
|
body: The issue received a response from the Author who confirms this to still be prominent and has therefore been reopened.
|
||||||
|
action: open
|
||||||
|
- name: 'Type: Question'
|
||||||
|
labeled:
|
||||||
|
issue:
|
||||||
|
body: |-
|
||||||
|
Hello @{{ issue.user.login }},
|
||||||
|
|
||||||
|
Thank you for reaching out to us for getting Support with PlaceholderAPI.
|
||||||
|
We would like to inform you, that we now have [Discussions](https://github.com/PlaceholderAPI/PlaceholderAPI/discussions) that you can use for asking questions.
|
||||||
|
Just head over there and click the "New discussion" button to create a new post.
|
||||||
|
|
||||||
|
Remember to first read the [READ ME](https://github.com/PlaceholderAPI/PlaceholderAPI/discussions/507) post to not face any issues.
|
||||||
|
|
||||||
|
For questions do we recommend to use the [Q&A Category](https://github.com/PlaceholderAPI/PlaceholderAPI/discussions?discussions_q=category%3AQ%26A).
|
||||||
|
You can also use the Discussion to submit Feature requests (Feature requests through issues are still accepted tho).
|
||||||
|
3
.github/workflows/label_comment.yml
vendored
3
.github/workflows/label_comment.yml
vendored
@ -12,6 +12,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
give_comment:
|
give_comment:
|
||||||
|
if: github.event.issue.state == 'open' || github.event.pull_request.state == 'open'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
@ -19,6 +20,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
ref: master
|
ref: master
|
||||||
- name: Send Issue/Pull request comment
|
- name: Send Issue/Pull request comment
|
||||||
uses: peaceiris/actions-label-commenter@v1.5.0
|
uses: peaceiris/actions-label-commenter@v1.8.2
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
51
CODE_OF_CONDUCT.md
Normal file
51
CODE_OF_CONDUCT.md
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
[homepage]: http://contributor-covenant.org
|
||||||
|
[version]: http://contributor-covenant.org/version/1/4/
|
||||||
|
|
||||||
|
[discord]: https://helpch.at/discord
|
||||||
|
|
||||||
|
## Code of Conduct
|
||||||
|
|
||||||
|
### Our Pledge
|
||||||
|
|
||||||
|
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
||||||
|
|
||||||
|
### Our Standards
|
||||||
|
|
||||||
|
Examples of behavior that contributes to creating a positive environment
|
||||||
|
include:
|
||||||
|
|
||||||
|
* Using welcoming and inclusive language
|
||||||
|
* Being respectful of differing viewpoints and experiences
|
||||||
|
* Gracefully accepting constructive criticism
|
||||||
|
* Focusing on what is best for the community
|
||||||
|
* Showing empathy towards other community members
|
||||||
|
|
||||||
|
Examples of unacceptable behavior by participants include:
|
||||||
|
|
||||||
|
* The use of sexualized language or imagery and unwelcome sexual attention or advances
|
||||||
|
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||||
|
* Public or private harassment
|
||||||
|
* Publishing others' private information, such as a physical or electronic address, without explicit permission
|
||||||
|
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||||
|
|
||||||
|
### Our Responsibilities
|
||||||
|
|
||||||
|
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
||||||
|
|
||||||
|
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
||||||
|
|
||||||
|
### Scope
|
||||||
|
|
||||||
|
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
||||||
|
|
||||||
|
### Enforcement
|
||||||
|
|
||||||
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team on their [discord server][discord]. All
|
||||||
|
complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
||||||
|
|
||||||
|
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
||||||
|
|
||||||
|
### Attribution
|
||||||
|
|
||||||
|
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||||
|
available at [http://contributor-covenant.org/version/1/4][version]
|
@ -38,7 +38,7 @@ PlaceholderAPI has been downloaded over 400,000 times and has been used concurre
|
|||||||
|
|
||||||
## Quick Links
|
## Quick Links
|
||||||
- [CI Server][ci]
|
- [CI Server][ci]
|
||||||
- [Expansions cloud]
|
- [Expansions Cloud]
|
||||||
- [Placeholder List]
|
- [Placeholder List]
|
||||||
- [Spigot Page][spigot]
|
- [Spigot Page][spigot]
|
||||||
- [Plugin Statistics][statistics]
|
- [Plugin Statistics][statistics]
|
||||||
|
20
build.gradle
20
build.gradle
@ -21,7 +21,7 @@ dependencies {
|
|||||||
implementation "com.google.code.gson:gson:2.8.6"
|
implementation "com.google.code.gson:gson:2.8.6"
|
||||||
implementation "org.bstats:bstats-bukkit:1.5"
|
implementation "org.bstats:bstats-bukkit:1.5"
|
||||||
|
|
||||||
compileOnly "org.spigotmc:spigot-api:1.16.1-R0.1-SNAPSHOT"
|
compileOnly "org.spigotmc:spigot-api:1.16.4-R0.1-SNAPSHOT"
|
||||||
compileOnly "org.jetbrains:annotations:19.0.0"
|
compileOnly "org.jetbrains:annotations:19.0.0"
|
||||||
|
|
||||||
testImplementation "org.openjdk.jmh:jmh-core:1.23"
|
testImplementation "org.openjdk.jmh:jmh-core:1.23"
|
||||||
@ -37,11 +37,23 @@ processResources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(JavaCompile) {
|
java {
|
||||||
options.encoding = "UTF-8"
|
|
||||||
|
|
||||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
targetCompatibility = JavaVersion.VERSION_1_8
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
|
||||||
|
withJavadocJar()
|
||||||
|
withSourcesJar()
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.withType(JavaCompile) {
|
||||||
|
options.encoding = "UTF-8"
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.withType(Javadoc) {
|
||||||
|
failOnError false
|
||||||
|
options.addStringOption('Xdoclint:none', '-quiet')
|
||||||
|
options.addStringOption('encoding', 'UTF-8')
|
||||||
|
options.addStringOption('charSet', 'UTF-8')
|
||||||
}
|
}
|
||||||
|
|
||||||
shadowJar {
|
shadowJar {
|
||||||
|
@ -29,6 +29,7 @@ import java.util.regex.Pattern;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||||
import me.clip.placeholderapi.expansion.Relational;
|
import me.clip.placeholderapi.expansion.Relational;
|
||||||
|
import me.clip.placeholderapi.expansion.manager.LocalExpansionManager;
|
||||||
import me.clip.placeholderapi.replacer.CharsReplacer;
|
import me.clip.placeholderapi.replacer.CharsReplacer;
|
||||||
import me.clip.placeholderapi.replacer.Replacer;
|
import me.clip.placeholderapi.replacer.Replacer;
|
||||||
import me.clip.placeholderapi.replacer.Replacer.Closure;
|
import me.clip.placeholderapi.replacer.Replacer.Closure;
|
||||||
@ -150,7 +151,7 @@ public final class PlaceholderAPI {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* set relational placeholders in the text specified placeholders are matched with the pattern
|
* set relational placeholders in the text specified placeholders are matched with the pattern
|
||||||
* %<rel_(identifier)_(params)>% when set with this method
|
* {@literal %<rel_(identifier)_(params)>%} when set with this method
|
||||||
*
|
*
|
||||||
* @param one First player to compare
|
* @param one First player to compare
|
||||||
* @param two Second player to compare
|
* @param two Second player to compare
|
||||||
@ -225,6 +226,8 @@ public final class PlaceholderAPI {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the normal placeholder pattern.
|
* Get the normal placeholder pattern.
|
||||||
|
*
|
||||||
|
* @return The default Placeholder Pattern
|
||||||
*/
|
*/
|
||||||
public static Pattern getPlaceholderPattern() {
|
public static Pattern getPlaceholderPattern() {
|
||||||
return PLACEHOLDER_PATTERN;
|
return PLACEHOLDER_PATTERN;
|
||||||
@ -232,6 +235,8 @@ public final class PlaceholderAPI {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the bracket placeholder pattern.
|
* Get the bracket placeholder pattern.
|
||||||
|
*
|
||||||
|
* @return the Bracket Placeholder Pattern
|
||||||
*/
|
*/
|
||||||
public static Pattern getBracketPlaceholderPattern() {
|
public static Pattern getBracketPlaceholderPattern() {
|
||||||
return BRACKET_PLACEHOLDER_PATTERN;
|
return BRACKET_PLACEHOLDER_PATTERN;
|
||||||
@ -239,6 +244,8 @@ public final class PlaceholderAPI {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the relational placeholder pattern.
|
* Get the relational placeholder pattern.
|
||||||
|
*
|
||||||
|
* @return The Relational Placeholder Pattern
|
||||||
*/
|
*/
|
||||||
public static Pattern getRelationalPlaceholderPattern() {
|
public static Pattern getRelationalPlaceholderPattern() {
|
||||||
return RELATIONAL_PLACEHOLDER_PATTERN;
|
return RELATIONAL_PLACEHOLDER_PATTERN;
|
||||||
@ -285,9 +292,9 @@ public final class PlaceholderAPI {
|
|||||||
/**
|
/**
|
||||||
* Get map of registered placeholders
|
* Get map of registered placeholders
|
||||||
*
|
*
|
||||||
|
* @deprecated Use {@link LocalExpansionManager#getExpansions()} instead.
|
||||||
|
*
|
||||||
* @return Map of registered placeholders
|
* @return Map of registered placeholders
|
||||||
* @deprecated Use {@link me.clip.placeholderapi.PlaceholderAPIPlugin().getLocalExpansionManager()
|
|
||||||
* .getExpansions()} instead.
|
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
@ -298,8 +305,12 @@ public final class PlaceholderAPI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated Please use {@link me.clip.placeholderapi.expansion.PlaceholderExpansion} to
|
* @deprecated Please use {@link PlaceholderExpansion} to
|
||||||
* register placeholders instead
|
* register placeholders instead
|
||||||
|
*
|
||||||
|
* @param plugin The Plugin to register with this {@link PlaceholderHook}
|
||||||
|
* @param placeholderHook The {@link PlaceholderHook} to register
|
||||||
|
* @return always false
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
@ -312,8 +323,12 @@ public final class PlaceholderAPI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated Please use {@link me.clip.placeholderapi.expansion.PlaceholderExpansion} to
|
* @deprecated Please use {@link PlaceholderExpansion} to
|
||||||
* register placeholders instead
|
* register placeholders instead
|
||||||
|
*
|
||||||
|
* @param identifier The identifier to use for the {@link PlaceholderHook}
|
||||||
|
* @param placeholderHook The {@link PlaceholderHook} to register
|
||||||
|
* @return always false
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
@ -325,8 +340,11 @@ public final class PlaceholderAPI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated Please use {@link me.clip.placeholderapi.expansion.PlaceholderExpansion} to
|
* @deprecated Please use {@link PlaceholderExpansion} to
|
||||||
* unregister placeholders instead
|
* unregister placeholders instead
|
||||||
|
*
|
||||||
|
* @param plugin The plugin to unregister
|
||||||
|
* @return always false
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
@ -339,8 +357,11 @@ public final class PlaceholderAPI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated Please use {@link me.clip.placeholderapi.expansion.PlaceholderExpansion} to
|
* @deprecated Please use {@link PlaceholderExpansion} to
|
||||||
* unregister placeholders instead
|
* unregister placeholders instead
|
||||||
|
*
|
||||||
|
* @param identifier The identifier to unregister
|
||||||
|
* @return always false
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
@ -352,6 +373,8 @@ public final class PlaceholderAPI {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated Will be removed in a future release.
|
* @deprecated Will be removed in a future release.
|
||||||
|
*
|
||||||
|
* @return Set of registered identifiers
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
@ -361,6 +384,8 @@ public final class PlaceholderAPI {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated Will be removed in a future release.
|
* @deprecated Will be removed in a future release.
|
||||||
|
*
|
||||||
|
* @return always null
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
@ -370,6 +395,12 @@ public final class PlaceholderAPI {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated Please use {@link #setPlaceholders(OfflinePlayer, String)} instead
|
* @deprecated Please use {@link #setPlaceholders(OfflinePlayer, String)} instead
|
||||||
|
*
|
||||||
|
* @param player The offline player to parse the placeholders against
|
||||||
|
* @param text The text to parse
|
||||||
|
* @param pattern The Pattern to use
|
||||||
|
* @param colorize If PlaceholderAPI should also parse color codes
|
||||||
|
* @return String with the parsed placeholders
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
@ -380,6 +411,12 @@ public final class PlaceholderAPI {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated Please use {@link #setPlaceholders(OfflinePlayer, List)} instead
|
* @deprecated Please use {@link #setPlaceholders(OfflinePlayer, List)} instead
|
||||||
|
*
|
||||||
|
* @param player The offline player to parse the placeholders against
|
||||||
|
* @param text The List of text to parse
|
||||||
|
* @param pattern The Pattern to use
|
||||||
|
* @param colorize If PlaceholderAPI should also parse color codes
|
||||||
|
* @return String with the parsed placeholders
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
@ -390,6 +427,11 @@ public final class PlaceholderAPI {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, List)} instead.
|
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, List)} instead.
|
||||||
|
*
|
||||||
|
* @param player The offline player to parse the placeholders against
|
||||||
|
* @param text The List of text to parse
|
||||||
|
* @param colorize If PlaceholderAPI should also parse color codes
|
||||||
|
* @return String with the parsed placeholders
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
@ -400,6 +442,11 @@ public final class PlaceholderAPI {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, List)} instead.
|
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, List)} instead.
|
||||||
|
*
|
||||||
|
* @param player The offline player to parse the placeholders against
|
||||||
|
* @param text The List of text to parse
|
||||||
|
* @param pattern The Pattern to use
|
||||||
|
* @return String with the parsed placeholders
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
@ -409,6 +456,11 @@ public final class PlaceholderAPI {
|
|||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @deprecated Will be removed in a future release.
|
* @deprecated Will be removed in a future release.
|
||||||
|
*
|
||||||
|
* @param player The offline player to parse the placeholders against
|
||||||
|
* @param text The text to parse
|
||||||
|
* @param colorize If PlaceholderAPI should also parse color codes
|
||||||
|
* @return String with the parsed placeholders
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
@ -418,6 +470,11 @@ public final class PlaceholderAPI {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated Will be removed in a future release.
|
* @deprecated Will be removed in a future release.
|
||||||
|
*
|
||||||
|
* @param player The offline player to parse the placeholders against
|
||||||
|
* @param text The List of text to parse
|
||||||
|
* @param colorize If PlaceholderAPI should also parse color codes
|
||||||
|
* @return String with the parsed placeholders
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
@ -427,6 +484,11 @@ public final class PlaceholderAPI {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, String)} instead.
|
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, String)} instead.
|
||||||
|
*
|
||||||
|
* @param player The offline player to parse the placeholders against
|
||||||
|
* @param text The text to parse
|
||||||
|
* @param colorize If PlaceholderAPI should also parse color codes
|
||||||
|
* @return String with the parsed placeholders
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
@ -436,6 +498,11 @@ public final class PlaceholderAPI {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, String)} instead.
|
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, String)} instead.
|
||||||
|
*
|
||||||
|
* @param player The offline player to parse the placeholders against
|
||||||
|
* @param text The text to parse
|
||||||
|
* @param pattern The Pattern to use
|
||||||
|
* @return String with the parsed placeholders
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
@ -445,6 +512,11 @@ public final class PlaceholderAPI {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, List)} instead.
|
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, List)} instead.
|
||||||
|
*
|
||||||
|
* @param player The offline player to parse the placeholders against
|
||||||
|
* @param text The List of text to parse
|
||||||
|
* @param colorize If PlaceholderAPI should also parse color codes
|
||||||
|
* @return String with the parsed placeholders
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
@ -455,6 +527,11 @@ public final class PlaceholderAPI {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, String)} instead.
|
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, String)} instead.
|
||||||
|
*
|
||||||
|
* @param player The offline player to parse the placeholders against
|
||||||
|
* @param text The text to parse
|
||||||
|
* @param colorize If PlaceholderAPI should also parse color codes
|
||||||
|
* @return String with the parsed placeholders
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
@ -464,6 +541,11 @@ public final class PlaceholderAPI {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated Will be removed in a future release.
|
* @deprecated Will be removed in a future release.
|
||||||
|
*
|
||||||
|
* @param player The offline player to parse the placeholders against
|
||||||
|
* @param text The text to parse
|
||||||
|
* @param colorize If PlaceholderAPI should also parse color codes
|
||||||
|
* @return String with the parsed placeholders
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
@ -473,6 +555,11 @@ public final class PlaceholderAPI {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated Will be removed in a future release.
|
* @deprecated Will be removed in a future release.
|
||||||
|
*
|
||||||
|
* @param player The offline player to parse the placeholders against
|
||||||
|
* @param text The List of text to parse
|
||||||
|
* @param colorize If PlaceholderAPI should also parse color codes
|
||||||
|
* @return String with the parsed placeholders
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
@ -483,12 +570,12 @@ public final class PlaceholderAPI {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* set relational placeholders in the text specified placeholders are matched with the pattern
|
* set relational placeholders in the text specified placeholders are matched with the pattern
|
||||||
* %<rel_(identifier)_(params)>% when set with this method
|
* {@literal %<rel_(identifier)_(params)>%} when set with this method
|
||||||
*
|
*
|
||||||
* @param one Player to compare
|
* @param one Player to compare
|
||||||
* @param two Player to compare
|
* @param two Player to compare
|
||||||
* @param text Text to parse the placeholders in
|
* @param text Text to parse the placeholders in
|
||||||
* @param colorize If color codes (&[0-1a-fk-o]) should be translated
|
* @param colorize If color codes ({@literal &[0-1a-fk-o]}) should be translated
|
||||||
* @return The text containing the parsed relational placeholders
|
* @return The text containing the parsed relational placeholders
|
||||||
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, String)} instead.
|
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, String)} instead.
|
||||||
*/
|
*/
|
||||||
@ -506,9 +593,9 @@ public final class PlaceholderAPI {
|
|||||||
* @param one First player to compare
|
* @param one First player to compare
|
||||||
* @param two Second player to compare
|
* @param two Second player to compare
|
||||||
* @param text Text to parse the placeholders in
|
* @param text Text to parse the placeholders in
|
||||||
* @param colorize If color codes (&[0-1a-fk-o]) should be translated
|
* @param colorize If color codes ({@literal &[0-1a-fk-o]}) should be translated
|
||||||
* @return The text containing the parsed relational placeholders
|
* @return The text containing the parsed relational placeholders
|
||||||
* @deprecated Use {@link #setRelationalPlaceholders(Player, Player, List<String>)} instead.
|
* @deprecated Use {@link #setRelationalPlaceholders(Player, Player, List)} instead.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
|
@ -47,7 +47,7 @@ public final class CommandInfo extends PlaceholderCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final PlaceholderExpansion expansion = plugin.getLocalExpansionManager()
|
final PlaceholderExpansion expansion = plugin.getLocalExpansionManager()
|
||||||
.findExpansionByName(params.get(0)).orElse(null);
|
.findExpansionByIdentifier(params.get(0)).orElse(null);
|
||||||
if (expansion == null) {
|
if (expansion == null) {
|
||||||
Msg.msg(sender,
|
Msg.msg(sender,
|
||||||
"&cThere is no expansion loaded with the identifier: &f" + params.get(0));
|
"&cThere is no expansion loaded with the identifier: &f" + params.get(0));
|
||||||
|
@ -0,0 +1,46 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of PlaceholderAPI
|
||||||
|
*
|
||||||
|
* PlaceholderAPI
|
||||||
|
* Copyright (c) 2015 - 2020 PlaceholderAPI Team
|
||||||
|
*
|
||||||
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package me.clip.placeholderapi.events;
|
||||||
|
|
||||||
|
|
||||||
|
import org.bukkit.event.Event;
|
||||||
|
import org.bukkit.event.HandlerList;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This event is called when all expansions are loaded (when reloading config, on plugin start and on server load).
|
||||||
|
*/
|
||||||
|
public class ExpansionsLoadedEvent extends Event {
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private static final HandlerList HANDLERS = new HandlerList();
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public HandlerList getHandlers() {
|
||||||
|
return HANDLERS;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public static HandlerList getHandlerList() {
|
||||||
|
return HANDLERS;
|
||||||
|
}
|
||||||
|
}
|
@ -39,7 +39,9 @@ public enum NMSVersion {
|
|||||||
SPIGOT_1_13_R2("v1_13_R2"),
|
SPIGOT_1_13_R2("v1_13_R2"),
|
||||||
SPIGOT_1_14_R1("v1_14_R1"),
|
SPIGOT_1_14_R1("v1_14_R1"),
|
||||||
SPIGOT_1_15_R1("v1_15_R1"),
|
SPIGOT_1_15_R1("v1_15_R1"),
|
||||||
SPIGOT_1_16_R1("v1_16_R1");
|
SPIGOT_1_16_R1("v1_16_R1"),
|
||||||
|
SPIGOT_1_16_R2("v1_16_R2"),
|
||||||
|
SPIGOT_1_16_R3("v1_16_R3");
|
||||||
|
|
||||||
private final String version;
|
private final String version;
|
||||||
|
|
||||||
|
@ -200,6 +200,12 @@ public abstract class PlaceholderExpansion extends PlaceholderHook {
|
|||||||
return section == null ? Collections.emptyList() : section.getStringList(path);
|
return section == null ? Collections.emptyList() : section.getStringList(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public final boolean getBoolean(@NotNull final String path, final boolean def) {
|
||||||
|
final ConfigurationSection section = getConfigSection();
|
||||||
|
return section == null ? def : section.getBoolean(path, def);
|
||||||
|
}
|
||||||
|
|
||||||
public final boolean configurationContains(@NotNull final String path) {
|
public final boolean configurationContains(@NotNull final String path) {
|
||||||
final ConfigurationSection section = getConfigSection();
|
final ConfigurationSection section = getConfigSection();
|
||||||
return section != null && section.contains(path);
|
return section != null && section.contains(path);
|
||||||
@ -231,6 +237,8 @@ public abstract class PlaceholderExpansion extends PlaceholderHook {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated As of versions greater than 2.8.7, use {@link #getRequiredPlugin()}
|
* @deprecated As of versions greater than 2.8.7, use {@link #getRequiredPlugin()}
|
||||||
|
*
|
||||||
|
* @return The plugin name.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
@ -240,6 +248,8 @@ public abstract class PlaceholderExpansion extends PlaceholderHook {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated As of versions greater than 2.8.7, use the expansion cloud to show a description
|
* @deprecated As of versions greater than 2.8.7, use the expansion cloud to show a description
|
||||||
|
*
|
||||||
|
* @return The description of the expansion.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
@ -249,6 +259,8 @@ public abstract class PlaceholderExpansion extends PlaceholderHook {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated As of versions greater than 2.8.7, use the expansion cloud to display a link
|
* @deprecated As of versions greater than 2.8.7, use the expansion cloud to display a link
|
||||||
|
*
|
||||||
|
* @return The link for the expansion.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
|
@ -34,6 +34,8 @@ public interface VersionSpecific {
|
|||||||
* This method is called before the expansion is attempted to be registered The server version
|
* This method is called before the expansion is attempted to be registered The server version
|
||||||
* will be passed to this method so you know what version the server is currently running.
|
* will be passed to this method so you know what version the server is currently running.
|
||||||
*
|
*
|
||||||
|
* @param v The {@link Version} to check against
|
||||||
|
*
|
||||||
* @return true if your expansion is compatible with the version the server is running.
|
* @return true if your expansion is compatible with the version the server is running.
|
||||||
*/
|
*/
|
||||||
boolean isCompatibleWith(Version v);
|
boolean isCompatibleWith(Version v);
|
||||||
|
@ -36,6 +36,7 @@ import java.util.logging.Level;
|
|||||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||||
import me.clip.placeholderapi.events.ExpansionRegisterEvent;
|
import me.clip.placeholderapi.events.ExpansionRegisterEvent;
|
||||||
import me.clip.placeholderapi.events.ExpansionUnregisterEvent;
|
import me.clip.placeholderapi.events.ExpansionUnregisterEvent;
|
||||||
|
import me.clip.placeholderapi.events.ExpansionsLoadedEvent;
|
||||||
import me.clip.placeholderapi.expansion.Cacheable;
|
import me.clip.placeholderapi.expansion.Cacheable;
|
||||||
import me.clip.placeholderapi.expansion.Cleanable;
|
import me.clip.placeholderapi.expansion.Cleanable;
|
||||||
import me.clip.placeholderapi.expansion.Configurable;
|
import me.clip.placeholderapi.expansion.Configurable;
|
||||||
@ -174,9 +175,6 @@ public final class LocalExpansionManager implements Listener {
|
|||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Do not call this method yourself, use {@link PlaceholderExpansion#register()}
|
|
||||||
*/
|
|
||||||
@ApiStatus.Internal
|
@ApiStatus.Internal
|
||||||
public boolean register(@NotNull final PlaceholderExpansion expansion) {
|
public boolean register(@NotNull final PlaceholderExpansion expansion) {
|
||||||
final String identifier = expansion.getIdentifier().toLowerCase();
|
final String identifier = expansion.getIdentifier().toLowerCase();
|
||||||
@ -270,9 +268,6 @@ public final class LocalExpansionManager implements Listener {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Do not call this method yourself, use {@link PlaceholderExpansion#unregister()}
|
|
||||||
*/
|
|
||||||
@ApiStatus.Internal
|
@ApiStatus.Internal
|
||||||
public boolean unregister(@NotNull final PlaceholderExpansion expansion) {
|
public boolean unregister(@NotNull final PlaceholderExpansion expansion) {
|
||||||
if (expansions.remove(expansion.getIdentifier()) == null) {
|
if (expansions.remove(expansion.getIdentifier()) == null) {
|
||||||
@ -320,6 +315,8 @@ public final class LocalExpansionManager implements Listener {
|
|||||||
Msg.msg(sender,
|
Msg.msg(sender,
|
||||||
registered == 0 ? "&6No expansions were registered!"
|
registered == 0 ? "&6No expansions were registered!"
|
||||||
: registered + "&a placeholder hooks successfully registered!");
|
: registered + "&a placeholder hooks successfully registered!");
|
||||||
|
|
||||||
|
Bukkit.getPluginManager().callEvent(new ExpansionsLoadedEvent());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user