mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2025-09-06 17:27:05 +02:00
Compare commits
28 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
b9881eb70b | ||
|
93f586a216 | ||
|
a0ac08b838 | ||
|
2c0b768774 | ||
|
21048f83d5 | ||
|
9af9a3570d | ||
|
16c237ce51 | ||
|
b44cb13d7a | ||
|
8c509b47d1 | ||
|
c4cba9c6a7 | ||
|
0809897303 | ||
|
82181ed74d | ||
|
85328c473b | ||
|
c9abc4ae00 | ||
|
5f23db98a8 | ||
|
f367abbdfa | ||
|
9377129554 | ||
|
f4409a6d92 | ||
|
c902485718 | ||
|
09db82a840 | ||
|
9b667fe383 | ||
|
00333f9a4e | ||
|
5472be631c | ||
|
68fa793354 | ||
|
111f5462fc | ||
|
62e282cc0e | ||
|
5aaa9720c8 | ||
|
9a2fb89e43 |
64
.github/CONTRIBUTING.md
vendored
Normal file
64
.github/CONTRIBUTING.md
vendored
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
[issue]: https://github.com/PlaceholderAPI/PlaceholderAPI/issues/new?template=change_request_placeholderapi.md
|
||||||
|
[Discord]: https://helpch.at/discord
|
||||||
|
[homepage]: http://contributor-covenant.org
|
||||||
|
[version]: http://contributor-covenant.org/version/1/4/
|
||||||
|
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
Please note we have a code of conduct, please follow it in all your interactions with the project.
|
||||||
|
|
||||||
|
## Pull Request Process
|
||||||
|
|
||||||
|
1. Update the README.md with details of changes if it is affected by those changes.
|
||||||
|
2. Try to prevent any breaking changes affecting the end-user (Developers using the API).
|
||||||
|
Mention any breaking changes that could affect the end-user.
|
||||||
|
3. Document any public methods that the end-user might use.
|
||||||
|
|
||||||
|
## 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 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]
|
22
.github/ISSUE_TEMPLATE/bug_report.md
vendored
22
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,21 +1,23 @@
|
|||||||
---
|
---
|
||||||
name: Bug Report
|
name: Bug Report
|
||||||
about: Found a bug with PlaceholderAPI? Report it through this form!
|
about: Report bugs of PlaceholderAPI with this template
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
[New placeholders/plugin]: https://github.com/PlaceholderAPI/PlaceholderAPI/issues/new?template=feature_request.md
|
[Request change (Wiki)]: https://github.com/PlaceholderAPI/PlaceholderAPI/issues/new?template=change_request_wiki.md
|
||||||
[Request change]: https://github.com/PlaceholderAPI/PlaceholderAPI/issues/new?template=change_request.md
|
[Request change (PlaceholderAPI)]: https://github.com/PlaceholderAPI/PlaceholderAPI/issues/new?template=change_request_placeholderapi.md
|
||||||
[Spigot page]: https://www.spigotmc.org/resources/6245/
|
[Spigot]: https://www.spigotmc.org/resources/6245/
|
||||||
[Jenkins page]: http://ci.extendedclip.com/job/PlaceholderAPI/
|
[Jenkins]: http://ci.extendedclip.com/job/PlaceholderAPI/
|
||||||
[issue]: https://github.com/PlaceholderAPI/PlaceholderAPI/issues
|
[issue]: https://github.com/PlaceholderAPI/PlaceholderAPI/issues
|
||||||
|
|
||||||
### Notes
|
## Please read
|
||||||
This template is for **reporting a bug** and not for requesting changes to the wiki!
|
This template is only for reporting bugs of PlaceholderAPI!
|
||||||
If you want your placeholders added or updated, use the [New placeholders/plugin] or [Request change] template.
|
If you want to request changes to the code of PlaceholderAPI, use the [Request change (PlaceholderAPI)] template.
|
||||||
|
For changes to the wiki use the [Request change (Wiki)] template.
|
||||||
|
|
||||||
Also make sure, that you use the latest version of PlaceholderAPI from either the [Spigot page] or the [Jenkins page] and that your
|
Please also make sure that you use the [latest release][Spigot] or the latest [developement build][Jenkins] and that your bug isn't already reported on the [issues] page.
|
||||||
issue isn't already listed in the [issue] page.
|
|
||||||
|
**Please report issues with expansions/placeholders to the corresponding issue tracker! Only report it here if you can't find any place to report it!**
|
||||||
|
|
||||||
### Issue
|
### Issue
|
||||||
> What is the issue? Describe it like you would tell a friend.
|
> What is the issue? Describe it like you would tell a friend.
|
||||||
|
36
.github/ISSUE_TEMPLATE/change_request.md
vendored
36
.github/ISSUE_TEMPLATE/change_request.md
vendored
@@ -1,36 +0,0 @@
|
|||||||
---
|
|
||||||
name: Request change
|
|
||||||
about: Request a update/change of a wiki-page
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
[New placeholders/plugin]: https://github.com/PlaceholderAPI/PlaceholderAPI/issues/new?template=feature_request.md
|
|
||||||
[Bug report]: https://github.com/PlaceholderAPI/PlaceholderAPI/issues/new?template=bug_report.md
|
|
||||||
[issues]: https://github.com/PlaceholderAPI/PlaceholderAPI/issues
|
|
||||||
[wiki]: https://github.com/PlaceholderAPI/PlaceholderAPI/wiki
|
|
||||||
|
|
||||||
### Notes
|
|
||||||
This template is for **requesting changes to the wiki** and not for reporting bugs or requesting additions for the wiki!
|
|
||||||
If you want your placeholders added, use the [New placeholders/plugin] template.
|
|
||||||
For bug reports, use the [Bug report] template.
|
|
||||||
|
|
||||||
Also make sure, that your requested change isn't already made in the [wiki] or listed in the [issues] page.
|
|
||||||
|
|
||||||
### Type
|
|
||||||
> What kind of change is it? (Multiple selections possible)
|
|
||||||
<!-- Please select the right one, by changing the [ ] to [x] -->
|
|
||||||
|
|
||||||
- [ ] Placeholder(s) changed.
|
|
||||||
- [ ] New placeholder(s).
|
|
||||||
- [ ] Plugin no longer supports PlaceholderAPI and/or was deleted.
|
|
||||||
|
|
||||||
### Plugin
|
|
||||||
> What is the name of the plugin?
|
|
||||||
<!-- Please type below this line -->
|
|
||||||
|
|
||||||
|
|
||||||
### What is the new value?
|
|
||||||
> **Placeholder(s) changed**: Type what the old and the new placeholder(s) is/are.
|
|
||||||
> **New Placeholder(s)**: Type the new placeholder(s).
|
|
||||||
> **Plugin no longer supports PlaceholderAPI**: Leave this blank.
|
|
||||||
<!-- Please type below this line -->
|
|
38
.github/ISSUE_TEMPLATE/change_request_placeholderapi.md
vendored
Normal file
38
.github/ISSUE_TEMPLATE/change_request_placeholderapi.md
vendored
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
---
|
||||||
|
name: Request change (PlaceholderAPI)
|
||||||
|
about: Request a update/change of the PlaceholderAPI-code
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
[Request change (Wiki)]: https://github.com/PlaceholderAPI/PlaceholderAPI/issues/new?template=change_request_wiki.md
|
||||||
|
[Bug report]: https://github.com/PlaceholderAPI/PlaceholderAPI/issues/new?template=bug_report.md
|
||||||
|
[issues]: https://github.com/PlaceholderAPI/PlaceholderAPI/issues
|
||||||
|
[wiki]: https://github.com/PlaceholderAPI/PlaceholderAPI/wiki
|
||||||
|
[Pull Requests]: https://github.com/PlaceholderAPI/PlaceholderAPI/pulls
|
||||||
|
|
||||||
|
## Please read
|
||||||
|
This template is only for requesting new functions to be added to PlaceholderAPI or for old one to be changed!
|
||||||
|
Please use the [Request change (Wiki)] template to ask for additions/changes to the wiki.
|
||||||
|
For reporting bugs of PlaceholderAPI use the [Bug report] template.
|
||||||
|
|
||||||
|
Also make sure that the [wiki] doesn't already mention such a function/change and that there isn't a issue about this change on the [issues] page.
|
||||||
|
|
||||||
|
We recommend to [open a Pull Request][Pull Requests] for making changes to PlaceholderAPI's code.
|
||||||
|
|
||||||
|
### Type
|
||||||
|
> What kind of request is this? (Multiple selections possible)
|
||||||
|
<!--
|
||||||
|
Please select the right options by replacing the [ ] with a [x]
|
||||||
|
-->
|
||||||
|
- [ ] New function for PlaceholderAPI.
|
||||||
|
A new function that developers could use.
|
||||||
|
- [ ] Change to code (Internal).
|
||||||
|
Changes to code that won't affect the end-user.
|
||||||
|
- [ ] Change to code (External).
|
||||||
|
Changes to code that will affect the end-user (breaks stuff).
|
||||||
|
- [ ] Other: __________ <!-- Use this if none of the above matches your request -->
|
||||||
|
|
||||||
|
### Info
|
||||||
|
> What is the change?
|
||||||
|
> Please provide as much information (including links, images and code-snippeds) as possible.
|
||||||
|
<!-- Please type below this line -->
|
34
.github/ISSUE_TEMPLATE/change_request_wiki.md
vendored
Normal file
34
.github/ISSUE_TEMPLATE/change_request_wiki.md
vendored
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
---
|
||||||
|
name: Request change (Wiki)
|
||||||
|
about: Request a update/change of a wiki-page
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
[Request change (PlaceholderAPI)]: https://github.com/PlaceholderAPI/PlaceholderAPI/issues/new?template=change_request_placeholderapi.md
|
||||||
|
[Bug report]: https://github.com/PlaceholderAPI/PlaceholderAPI/issues/new?template=bug_report.md
|
||||||
|
[issues]: https://github.com/PlaceholderAPI/PlaceholderAPI/issues
|
||||||
|
[wiki]: https://github.com/PlaceholderAPI/PlaceholderAPI/wiki
|
||||||
|
|
||||||
|
## Please read
|
||||||
|
This template is only for requesting new information to be added to the wiki or for updating of already existing information!
|
||||||
|
Please use the [Request change (PlaceholderAPI)] template to ask for additions/changes to the plugin PlaceholderAPI.
|
||||||
|
For reporting bugs of PlaceholderAPI use the [Bug report] template.
|
||||||
|
|
||||||
|
Also make sure that the [wiki] doesn't already have the change and that there isn't a issue about this change on the [issues] page.
|
||||||
|
|
||||||
|
### Type
|
||||||
|
> What kind of change is it? (Multiple selections possible)
|
||||||
|
<!--
|
||||||
|
Please select the right one, by changing the [ ] to [x]
|
||||||
|
-->
|
||||||
|
- [ ] New plugin/expansion supporting PlaceholderAPI.
|
||||||
|
A new plugin/expansion uses and/or provides placeholders.
|
||||||
|
- [ ] Placeholder(s) changed.
|
||||||
|
An already listed expansion/plugin has new placeholders or old ones have changed.
|
||||||
|
- [ ] Plugin/Expansion no longer supports PlaceholderAPI and/or was deleted.
|
||||||
|
- [ ] Other: __________ <!-- Use this if none of the above matches your request -->
|
||||||
|
|
||||||
|
### Info
|
||||||
|
> Please provide any information that is useful including links and images.
|
||||||
|
> For plugins/expansion providing new placeholders or updating old ones, provide the placeholders (that have changed)
|
||||||
|
<!-- Please type below this line -->
|
35
.github/ISSUE_TEMPLATE/feature_request.md
vendored
35
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -1,35 +0,0 @@
|
|||||||
---
|
|
||||||
name: New placeholders/plugin
|
|
||||||
about: Do you have a plugin that supports and/or adds placeholders from/to PlaceholderAPI and that isn't on the wiki? Use this template!
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
[Request change]: https://github.com/PlaceholderAPI/PlaceholderAPI/issues/new?template=change_request.md
|
|
||||||
[Bug report]: https://github.com/PlaceholderAPI/PlaceholderAPI/issues/new?template=bug_report.md
|
|
||||||
[issues]: https://github.com/PlaceholderAPI/PlaceholderAPI/issues
|
|
||||||
[wiki]: https://github.com/PlaceholderAPI/PlaceholderAPI/wiki
|
|
||||||
|
|
||||||
### Notes
|
|
||||||
This template is for **requesting additions for the wiki** and not for reporting bugs or requesting changes for the wiki!
|
|
||||||
If you want changes to be made to the wiki, use the [Request change] template.
|
|
||||||
For bug reports, use the [Bug report] template.
|
|
||||||
|
|
||||||
Also make sure, that your requested placeholders/plugin isn't already added in the [wiki] or listed in the [issues] page.
|
|
||||||
|
|
||||||
### Type
|
|
||||||
> What kind of request is this? (Multiple selections possible)
|
|
||||||
<!-- Select the right option by replacing [ ] with [x] -->
|
|
||||||
<!-- For an update of an already listed plugin, use the "Request change" template -->
|
|
||||||
|
|
||||||
- [ ] New expansion providing placeholders.
|
|
||||||
- [ ] New plugin providing placeholders.
|
|
||||||
- [ ] New plugin supporting PlaceholderAPI.
|
|
||||||
|
|
||||||
### Plugin
|
|
||||||
> What is the name of the plugin/expansion?
|
|
||||||
> Provide also a link to it.
|
|
||||||
<!-- Please type below this line -->
|
|
||||||
|
|
||||||
### Placeholders/others
|
|
||||||
> What are the new placeholders/Any additional info?
|
|
||||||
<!-- Please type below this line -->
|
|
20
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
20
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
[Pull requests]: https://github.com/PlaceholderAPI/PlaceholderAPI/pulls
|
||||||
|
[contributing file]: https://github.com/PlaceholderAPI/PlaceholderAPI/tree/master/.github/CONTRIBUTING.md
|
||||||
|
|
||||||
|
## Please read
|
||||||
|
Please make sure you checked the following:
|
||||||
|
- You checked the [Pull requests] page for any upcoming changes.
|
||||||
|
- You documented any public code that the end-user might use.
|
||||||
|
- You followed the [contributing file]
|
||||||
|
|
||||||
|
### Type
|
||||||
|
<!--
|
||||||
|
Please select the right one, by changing the [ ] to [x]
|
||||||
|
-->
|
||||||
|
- [ ] Internal change (Doesn't affect end-user).
|
||||||
|
- [ ] External change (Does affect end-user).
|
||||||
|
- [ ] Other: __________ <!-- Use this if none of the above matches your request -->
|
||||||
|
|
||||||
|
### Description
|
||||||
|
> Provide additional information if needed.
|
||||||
|
<!-- Please type below this line -->
|
4
pom.xml
4
pom.xml
@@ -6,7 +6,7 @@
|
|||||||
<groupId>me.clip</groupId>
|
<groupId>me.clip</groupId>
|
||||||
<artifactId>placeholderapi</artifactId>
|
<artifactId>placeholderapi</artifactId>
|
||||||
|
|
||||||
<version>2.10.1</version>
|
<version>2.10.3</version>
|
||||||
<name>PlaceholderAPI</name>
|
<name>PlaceholderAPI</name>
|
||||||
<description>An awesome placeholder provider!</description>
|
<description>An awesome placeholder provider!</description>
|
||||||
<url>http://extendedclip.com</url>
|
<url>http://extendedclip.com</url>
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
<artifactId>spigot-api</artifactId>
|
<artifactId>spigot-api</artifactId>
|
||||||
<version>1.14-R0.1-SNAPSHOT</version>
|
<version>1.14.1-R0.1-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (C) 2018 Ryan McCarthy
|
* Copyright (C) 2019 Ryan McCarthy
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,18 +20,8 @@
|
|||||||
*/
|
*/
|
||||||
package me.clip.placeholderapi;
|
package me.clip.placeholderapi;
|
||||||
|
|
||||||
import static me.clip.placeholderapi.util.Msg.color;
|
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.regex.Matcher;
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
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.expansion.PlaceholderExpansion;
|
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||||
@@ -42,6 +32,13 @@ import org.bukkit.OfflinePlayer;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import static me.clip.placeholderapi.util.Msg.color;
|
||||||
|
|
||||||
public class PlaceholderAPI {
|
public class PlaceholderAPI {
|
||||||
|
|
||||||
private static final Pattern PLACEHOLDER_PATTERN = Pattern.compile("[%]([^%]+)[%]");
|
private static final Pattern PLACEHOLDER_PATTERN = Pattern.compile("[%]([^%]+)[%]");
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (C) 2018 Ryan McCarthy
|
* Copyright (C) 2019 Ryan McCarthy
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,10 +20,6 @@
|
|||||||
*/
|
*/
|
||||||
package me.clip.placeholderapi;
|
package me.clip.placeholderapi;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
import me.clip.placeholderapi.commands.PlaceholderAPICommands;
|
import me.clip.placeholderapi.commands.PlaceholderAPICommands;
|
||||||
import me.clip.placeholderapi.configuration.PlaceholderAPIConfig;
|
import me.clip.placeholderapi.configuration.PlaceholderAPIConfig;
|
||||||
import me.clip.placeholderapi.expansion.ExpansionManager;
|
import me.clip.placeholderapi.expansion.ExpansionManager;
|
||||||
@@ -39,6 +35,11 @@ import org.bukkit.ChatColor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Yes I have a shit load of work to do...
|
* Yes I have a shit load of work to do...
|
||||||
@@ -137,18 +138,15 @@ public class PlaceholderAPIPlugin extends JavaPlugin {
|
|||||||
Class.forName("org.bukkit.event.server.ServerLoadEvent");
|
Class.forName("org.bukkit.event.server.ServerLoadEvent");
|
||||||
new ServerLoadEventListener(this);
|
new ServerLoadEventListener(this);
|
||||||
} catch (ExceptionInInitializerError | ClassNotFoundException exception) {
|
} catch (ExceptionInInitializerError | ClassNotFoundException exception) {
|
||||||
Bukkit.getScheduler().runTaskLater(this, new Runnable() {
|
Bukkit.getScheduler().runTaskLater(this, () -> {
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
getLogger().info("Placeholder expansion registration initializing...");
|
getLogger().info("Placeholder expansion registration initializing...");
|
||||||
//fetch any hooks that may have registered externally onEnable first otherwise they will be lost
|
//fetch any hooks that may have registered externally onEnable first otherwise they will be lost
|
||||||
final Map<String, PlaceholderHook> alreadyRegistered = PlaceholderAPI.getPlaceholders();
|
final Map<String, PlaceholderHook> alreadyRegistered = PlaceholderAPI.getPlaceholders();
|
||||||
getExpansionManager().registerAllExpansions();
|
getExpansionManager().registerAllExpansions();
|
||||||
if (alreadyRegistered != null && !alreadyRegistered.isEmpty()) {
|
if (alreadyRegistered != null && !alreadyRegistered.isEmpty()) {
|
||||||
alreadyRegistered.entrySet().stream().forEach(hook -> PlaceholderAPI.registerPlaceholderHook(hook.getKey(), hook.getValue()));
|
alreadyRegistered.forEach(PlaceholderAPI::registerPlaceholderHook);
|
||||||
}
|
}
|
||||||
}
|
}, 1);
|
||||||
}, 20*15);
|
|
||||||
}
|
}
|
||||||
if (config.checkUpdates()) {
|
if (config.checkUpdates()) {
|
||||||
new UpdateChecker(this).fetch();
|
new UpdateChecker(this).fetch();
|
||||||
@@ -157,7 +155,7 @@ public class PlaceholderAPIPlugin extends JavaPlugin {
|
|||||||
enableCloud();
|
enableCloud();
|
||||||
}
|
}
|
||||||
setupMetrics();
|
setupMetrics();
|
||||||
getServer().getScheduler().runTaskLater(this, this::checkHook, 20 * 30);
|
getServer().getScheduler().runTaskLater(this, this::checkHook, 40);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -196,8 +194,10 @@ public class PlaceholderAPIPlugin extends JavaPlugin {
|
|||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
author = "the author of the hook's plugin";
|
author = "the author of the hook's plugin";
|
||||||
}
|
}
|
||||||
getLogger().warning(((EZPlaceholderHook) h).getPluginName() + " is currently using a deprecated method to hook into PlaceholderAPI. This will be disabled after the next update. " +
|
getLogger().severe(((EZPlaceholderHook) h).getPluginName() + " is currently using a deprecated method to hook into PlaceholderAPI. Placeholders for that plugin no longer work. " +
|
||||||
"Please consult {author} and urge them to update it ASAP.".replace("{author}", author));
|
"Please consult {author} and urge them to update it ASAP.".replace("{author}", author));
|
||||||
|
// disable the hook on startup
|
||||||
|
PlaceholderAPI.unregisterPlaceholderHook(((EZPlaceholderHook) h).getPlaceholderName());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (C) 2018 Ryan McCarthy
|
* Copyright (C) 2019 Ryan McCarthy
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (C) 2018 Ryan McCarthy
|
* Copyright (C) 2019 Ryan McCarthy
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,9 +20,6 @@
|
|||||||
*/
|
*/
|
||||||
package me.clip.placeholderapi;
|
package me.clip.placeholderapi;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Map.Entry;
|
|
||||||
import java.util.Set;
|
|
||||||
import me.clip.placeholderapi.events.ExpansionUnregisterEvent;
|
import me.clip.placeholderapi.events.ExpansionUnregisterEvent;
|
||||||
import me.clip.placeholderapi.expansion.Cacheable;
|
import me.clip.placeholderapi.expansion.Cacheable;
|
||||||
import me.clip.placeholderapi.expansion.Cleanable;
|
import me.clip.placeholderapi.expansion.Cleanable;
|
||||||
@@ -37,6 +34,10 @@ import org.bukkit.event.Listener;
|
|||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
import org.bukkit.event.server.PluginDisableEvent;
|
import org.bukkit.event.server.PluginDisableEvent;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class PlaceholderListener implements Listener {
|
public class PlaceholderListener implements Listener {
|
||||||
|
|
||||||
|
@@ -1,11 +1,32 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* PlaceholderAPI
|
||||||
|
* Copyright (C) 2019 Ryan McCarthy
|
||||||
|
*
|
||||||
|
* This program is 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.
|
||||||
|
*
|
||||||
|
* This program 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;
|
package me.clip.placeholderapi;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.server.ServerLoadEvent;
|
import org.bukkit.event.server.ServerLoadEvent;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public class ServerLoadEventListener implements Listener {
|
public class ServerLoadEventListener implements Listener {
|
||||||
|
|
||||||
private PlaceholderAPIPlugin plugin;
|
private PlaceholderAPIPlugin plugin;
|
||||||
@@ -15,15 +36,22 @@ public class ServerLoadEventListener implements Listener {
|
|||||||
Bukkit.getPluginManager().registerEvents(this, instance);
|
Bukkit.getPluginManager().registerEvents(this, instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method will be called when the server is first loaded
|
||||||
|
*
|
||||||
|
* The goal of the method is to register all the expansions as soon as possible
|
||||||
|
* especially before players can join
|
||||||
|
*
|
||||||
|
* This will ensure no issues with expanions and hooks.
|
||||||
|
* @param e the server load event
|
||||||
|
*/
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onServerLoad(ServerLoadEvent e) {
|
public void onServerLoad(ServerLoadEvent e) {
|
||||||
plugin.getLogger().info("Placeholder expansion registration initializing...");
|
plugin.getLogger().info("Placeholder expansion registration initializing...");
|
||||||
final Map<String, PlaceholderHook> alreadyRegistered = PlaceholderAPI.getPlaceholders();
|
final Map<String, PlaceholderHook> alreadyRegistered = PlaceholderAPI.getPlaceholders();
|
||||||
plugin.getExpansionManager().registerAllExpansions();
|
plugin.getExpansionManager().registerAllExpansions();
|
||||||
if (alreadyRegistered != null && !alreadyRegistered.isEmpty()) {
|
if (alreadyRegistered != null && !alreadyRegistered.isEmpty()) {
|
||||||
alreadyRegistered.entrySet().stream().forEach(hook -> {
|
alreadyRegistered.forEach(PlaceholderAPI::registerPlaceholderHook);
|
||||||
PlaceholderAPI.registerPlaceholderHook(hook.getKey(), hook.getValue());
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (C) 2018 Ryan McCarthy
|
* Copyright (C) 2019 Ryan McCarthy
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,13 +20,6 @@
|
|||||||
*/
|
*/
|
||||||
package me.clip.placeholderapi.commands;
|
package me.clip.placeholderapi.commands;
|
||||||
|
|
||||||
import static me.clip.placeholderapi.util.Msg.color;
|
|
||||||
import static me.clip.placeholderapi.util.Msg.msg;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import me.clip.placeholderapi.PlaceholderAPI;
|
import me.clip.placeholderapi.PlaceholderAPI;
|
||||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||||
@@ -37,6 +30,14 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import static me.clip.placeholderapi.util.Msg.color;
|
||||||
|
import static me.clip.placeholderapi.util.Msg.msg;
|
||||||
|
|
||||||
public class ExpansionCloudCommands implements CommandExecutor {
|
public class ExpansionCloudCommands implements CommandExecutor {
|
||||||
|
|
||||||
private PlaceholderAPIPlugin plugin;
|
private PlaceholderAPIPlugin plugin;
|
||||||
@@ -327,7 +328,7 @@ public class ExpansionCloudCommands implements CommandExecutor {
|
|||||||
expansions.put(exp.getName(), exp);
|
expansions.put(exp.getName(), exp);
|
||||||
}
|
}
|
||||||
List<String> ce = expansions.keySet().stream().sorted().collect(Collectors.toList());
|
List<String> ce = expansions.keySet().stream().sorted().collect(Collectors.toList());
|
||||||
int i = 1;
|
int i = (int) ex.keySet().toArray()[0];
|
||||||
for (String name : ce) {
|
for (String name : ce) {
|
||||||
if (expansions.get(name) == null) {
|
if (expansions.get(name) == null) {
|
||||||
continue;
|
continue;
|
||||||
@@ -353,7 +354,7 @@ public class ExpansionCloudCommands implements CommandExecutor {
|
|||||||
expansions.put(exp.getName(), exp);
|
expansions.put(exp.getName(), exp);
|
||||||
}
|
}
|
||||||
List<String> ce = expansions.keySet().stream().sorted().collect(Collectors.toList());
|
List<String> ce = expansions.keySet().stream().sorted().collect(Collectors.toList());
|
||||||
int i = 1;
|
int i = page > 1 ? page * 10 : 0;
|
||||||
for (String name : ce) {
|
for (String name : ce) {
|
||||||
if (expansions.get(name) == null) {
|
if (expansions.get(name) == null) {
|
||||||
continue;
|
continue;
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (C) 2018 Ryan McCarthy
|
* Copyright (C) 2019 Ryan McCarthy
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,8 +20,6 @@
|
|||||||
*/
|
*/
|
||||||
package me.clip.placeholderapi.commands;
|
package me.clip.placeholderapi.commands;
|
||||||
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import me.clip.placeholderapi.PlaceholderAPI;
|
import me.clip.placeholderapi.PlaceholderAPI;
|
||||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||||
@@ -34,6 +32,9 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
public class PlaceholderAPICommands implements CommandExecutor {
|
public class PlaceholderAPICommands implements CommandExecutor {
|
||||||
|
|
||||||
private PlaceholderAPIPlugin plugin;
|
private PlaceholderAPIPlugin plugin;
|
||||||
@@ -49,7 +50,7 @@ public class PlaceholderAPICommands implements CommandExecutor {
|
|||||||
if (args.length == 0) {
|
if (args.length == 0) {
|
||||||
|
|
||||||
Msg.msg(s, "PlaceholderAPI &7version &b&o" + plugin.getDescription().getVersion(),
|
Msg.msg(s, "PlaceholderAPI &7version &b&o" + plugin.getDescription().getVersion(),
|
||||||
"&fCreated by&7: &bextended_clip",
|
"&fCreated by&7: &b" + plugin.getDescription().getAuthors(),
|
||||||
"&fPapi commands: &b/papi help",
|
"&fPapi commands: &b/papi help",
|
||||||
"&fEcloud commands: &b/papi ecloud");
|
"&fEcloud commands: &b/papi ecloud");
|
||||||
return true;
|
return true;
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (C) 2018 Ryan McCarthy
|
* Copyright (C) 2019 Ryan McCarthy
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (C) 2018 Ryan McCarthy
|
* Copyright (C) 2019 Ryan McCarthy
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (C) 2018 Ryan McCarthy
|
* Copyright (C) 2019 Ryan McCarthy
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (C) 2018 Ryan McCarthy
|
* Copyright (C) 2019 Ryan McCarthy
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (C) 2018 Ryan McCarthy
|
* Copyright (C) 2019 Ryan McCarthy
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (C) 2018 Ryan McCarthy
|
* Copyright (C) 2019 Ryan McCarthy
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (C) 2018 Ryan McCarthy
|
* Copyright (C) 2019 Ryan McCarthy
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (C) 2018 Ryan McCarthy
|
* Copyright (C) 2019 Ryan McCarthy
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,11 +20,6 @@
|
|||||||
*/
|
*/
|
||||||
package me.clip.placeholderapi.expansion;
|
package me.clip.placeholderapi.expansion;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.lang.reflect.Constructor;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Map.Entry;
|
|
||||||
import me.clip.placeholderapi.PlaceholderAPI;
|
import me.clip.placeholderapi.PlaceholderAPI;
|
||||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||||
import me.clip.placeholderapi.PlaceholderHook;
|
import me.clip.placeholderapi.PlaceholderHook;
|
||||||
@@ -34,6 +29,12 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.lang.reflect.Constructor;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
public final class ExpansionManager {
|
public final class ExpansionManager {
|
||||||
private PlaceholderAPIPlugin plugin;
|
private PlaceholderAPIPlugin plugin;
|
||||||
|
|
||||||
@@ -65,6 +66,7 @@ public final class ExpansionManager {
|
|||||||
String pre = "expansions." + expansion.getIdentifier() + ".";
|
String pre = "expansions." + expansion.getIdentifier() + ".";
|
||||||
FileConfiguration cfg = plugin.getConfig();
|
FileConfiguration cfg = plugin.getConfig();
|
||||||
boolean save = false;
|
boolean save = false;
|
||||||
|
if (defaults != null) {
|
||||||
for (Entry<String, Object> entries : defaults.entrySet()) {
|
for (Entry<String, Object> entries : defaults.entrySet()) {
|
||||||
if (entries.getKey() == null || entries.getKey().isEmpty()) {
|
if (entries.getKey() == null || entries.getKey().isEmpty()) {
|
||||||
continue;
|
continue;
|
||||||
@@ -81,6 +83,7 @@ public final class ExpansionManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (save) {
|
if (save) {
|
||||||
plugin.saveConfig();
|
plugin.saveConfig();
|
||||||
plugin.reloadConfig();
|
plugin.reloadConfig();
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (C) 2018 Ryan McCarthy
|
* Copyright (C) 2019 Ryan McCarthy
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (C) 2018 Ryan McCarthy
|
* Copyright (C) 2019 Ryan McCarthy
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,7 +20,6 @@
|
|||||||
*/
|
*/
|
||||||
package me.clip.placeholderapi.expansion;
|
package me.clip.placeholderapi.expansion;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import me.clip.placeholderapi.PlaceholderAPI;
|
import me.clip.placeholderapi.PlaceholderAPI;
|
||||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||||
import me.clip.placeholderapi.PlaceholderHook;
|
import me.clip.placeholderapi.PlaceholderHook;
|
||||||
@@ -28,6 +27,8 @@ import org.apache.commons.lang.Validate;
|
|||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public abstract class PlaceholderExpansion extends PlaceholderHook {
|
public abstract class PlaceholderExpansion extends PlaceholderHook {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (C) 2018 Ryan McCarthy
|
* Copyright (C) 2019 Ryan McCarthy
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (C) 2018 Ryan McCarthy
|
* Copyright (C) 2019 Ryan McCarthy
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (C) 2018 Ryan McCarthy
|
* Copyright (C) 2019 Ryan McCarthy
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (C) 2018 Ryan McCarthy
|
* Copyright (C) 2019 Ryan McCarthy
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (C) 2018 Ryan McCarthy
|
* Copyright (C) 2019 Ryan McCarthy
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,10 +20,11 @@
|
|||||||
*/
|
*/
|
||||||
package me.clip.placeholderapi.expansion.cloud;
|
package me.clip.placeholderapi.expansion.cloud;
|
||||||
|
|
||||||
|
import me.clip.placeholderapi.util.TimeUtil;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import me.clip.placeholderapi.util.TimeUtil;
|
|
||||||
|
|
||||||
|
|
||||||
public class CloudExpansion {
|
public class CloudExpansion {
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (C) 2018 Ryan McCarthy
|
* Copyright (C) 2019 Ryan McCarthy
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -21,19 +21,6 @@
|
|||||||
package me.clip.placeholderapi.expansion.cloud;
|
package me.clip.placeholderapi.expansion.cloud;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.InputStreamReader;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.net.URLConnection;
|
|
||||||
import java.util.*;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import java.util.stream.IntStream;
|
|
||||||
|
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
import me.clip.placeholderapi.PlaceholderAPI;
|
import me.clip.placeholderapi.PlaceholderAPI;
|
||||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||||
@@ -42,6 +29,13 @@ import me.clip.placeholderapi.util.Msg;
|
|||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.net.URLConnection;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.IntStream;
|
||||||
|
|
||||||
public class ExpansionCloudManager {
|
public class ExpansionCloudManager {
|
||||||
|
|
||||||
private static final String API_URL = "http://api.extendedclip.com/v2/";
|
private static final String API_URL = "http://api.extendedclip.com/v2/";
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (C) 2018 Ryan McCarthy
|
* Copyright (C) 2019 Ryan McCarthy
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@@ -1,9 +1,25 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* PlaceholderAPI
|
||||||
|
* Copyright (C) 2019 Ryan McCarthy
|
||||||
|
*
|
||||||
|
* This program is 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.
|
||||||
|
*
|
||||||
|
* This program 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.updatechecker;
|
package me.clip.placeholderapi.updatechecker;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
|
||||||
import java.io.InputStreamReader;
|
|
||||||
import java.net.URL;
|
|
||||||
import javax.net.ssl.HttpsURLConnection;
|
|
||||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||||
import me.clip.placeholderapi.util.Msg;
|
import me.clip.placeholderapi.util.Msg;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@@ -12,6 +28,11 @@ import org.bukkit.event.EventPriority;
|
|||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.player.PlayerJoinEvent;
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
|
|
||||||
|
import javax.net.ssl.HttpsURLConnection;
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.net.URL;
|
||||||
|
|
||||||
public class UpdateChecker implements Listener {
|
public class UpdateChecker implements Listener {
|
||||||
|
|
||||||
private final int RESOURCE_ID = 6245;
|
private final int RESOURCE_ID = 6245;
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (C) 2018 Ryan McCarthy
|
* Copyright (C) 2019 Ryan McCarthy
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,6 +20,8 @@
|
|||||||
*/
|
*/
|
||||||
package me.clip.placeholderapi.util;
|
package me.clip.placeholderapi.util;
|
||||||
|
|
||||||
|
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FilenameFilter;
|
import java.io.FilenameFilter;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
@@ -28,7 +30,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.jar.JarEntry;
|
import java.util.jar.JarEntry;
|
||||||
import java.util.jar.JarInputStream;
|
import java.util.jar.JarInputStream;
|
||||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
|
||||||
|
|
||||||
public class FileUtil {
|
public class FileUtil {
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (C) 2018 Ryan McCarthy
|
* Copyright (C) 2019 Ryan McCarthy
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,11 +20,12 @@
|
|||||||
*/
|
*/
|
||||||
package me.clip.placeholderapi.util;
|
package me.clip.placeholderapi.util;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
public class Msg {
|
public class Msg {
|
||||||
|
|
||||||
public static void msg(CommandSender s, String... msg) {
|
public static void msg(CommandSender s, String... msg) {
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (C) 2018 Ryan McCarthy
|
* Copyright (C) 2019 Ryan McCarthy
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (C) 2018 Ryan McCarthy
|
* Copyright (C) 2019 Ryan McCarthy
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -27,9 +27,7 @@ public class TimeUtil {
|
|||||||
if (seconds < 60) {
|
if (seconds < 60) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case DAYS:
|
case DAYS:
|
||||||
return "0";
|
|
||||||
case HOURS:
|
case HOURS:
|
||||||
return "0";
|
|
||||||
case MINUTES:
|
case MINUTES:
|
||||||
return "0";
|
return "0";
|
||||||
case SECONDS:
|
case SECONDS:
|
||||||
@@ -44,7 +42,6 @@ public class TimeUtil {
|
|||||||
if (minutes < 60) {
|
if (minutes < 60) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case DAYS:
|
case DAYS:
|
||||||
return "0";
|
|
||||||
case HOURS:
|
case HOURS:
|
||||||
return "0";
|
return "0";
|
||||||
case MINUTES:
|
case MINUTES:
|
||||||
@@ -118,9 +115,9 @@ public class TimeUtil {
|
|||||||
int secondsLeft = seconds - s;
|
int secondsLeft = seconds - s;
|
||||||
if (minutes < 60) {
|
if (minutes < 60) {
|
||||||
if (secondsLeft > 0) {
|
if (secondsLeft > 0) {
|
||||||
return String.valueOf(minutes + "m " + secondsLeft + "s");
|
return minutes + "m " + secondsLeft + "s";
|
||||||
} else {
|
} else {
|
||||||
return String.valueOf(minutes + "m");
|
return minutes + "m";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (minutes < 1440) {
|
if (minutes < 1440) {
|
||||||
|
@@ -1,9 +1,8 @@
|
|||||||
name: ${project.name}
|
name: ${project.name}
|
||||||
main: me.clip.placeholderapi.PlaceholderAPIPlugin
|
main: me.clip.placeholderapi.PlaceholderAPIPlugin
|
||||||
version: ${project.version}
|
version: ${project.version}
|
||||||
author: [extended_clip]
|
authors: [extended_clip, Glare]
|
||||||
description: ${project.description}
|
description: ${project.description}
|
||||||
api-version: 1.13
|
|
||||||
permissions:
|
permissions:
|
||||||
placeholderapi.*:
|
placeholderapi.*:
|
||||||
description: ability to use all commands
|
description: ability to use all commands
|
||||||
@@ -39,4 +38,4 @@ permissions:
|
|||||||
commands:
|
commands:
|
||||||
placeholderapi:
|
placeholderapi:
|
||||||
description: PlaceholderAPI command
|
description: PlaceholderAPI command
|
||||||
aliases: [clipsplaceholderapi, papi]
|
aliases: [papi]
|
||||||
|
Reference in New Issue
Block a user