diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index c4ab045..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -name: Bug Report -about: Report bugs of PlaceholderAPI with this template - ---- - - -## Bug Report - -### Issue - - - -### Expected behaviour - - - -### Actual behaviour - - - -### How to reproduce - - -1. - -### `/papi dump` output - diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..bb353aa --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,101 @@ +name: Bug Report +description: Found a Bug about PlaceholderAPI? Use this template to report it! +labels: +- "Type: Issue (Unconfirmed)" +body: +- type: markdown + attributes: + value: |- + Thank you for taking your time and opening a Bug Report. + In order for us to process this Bug Report as fast and efficient as possible do we ask you to read the form carefully and provide any requested information. + Required fields are marked with an asterisk symbol (`*`) + + Also, always make sure to use the latest Release from [Spigot](https://www.spigotmc.org/resources/6245/) or the latest Development Build from our [Jenkins Server](http://ci.extendedclip.com/job/PlaceholderAPI/) to make sure that your issue isn't already fixed. + + **DO NOT REPORT ISSUES WITH EXPANSIONS AND/OR PLACEHOLDERS. USE THE APPROPRIATE ISSUE TRACKER FOR THOSE!** +- type: checkboxes + attributes: + label: Confirmation + description: Please make sure to have followed the following checks. + options: + - label: My issue isn't already found on the Issue tracker. + required: true + - label: My issue is about **PlaceholderAPI** and not any expansion or external plugin + required: true + - label: The issue isn't already fixed in a Spigot Release or Development Build. + required: true +- type: dropdown + attributes: + label: "Type" + description: |- + What kind of Bug do you encounter? + + - `Plugin Bug`: PlaceholderAPI doesn't startup properly. + - `API Bug`: A method you use didn't work or has an unexpected result. + - `Plugin/Server Incompatability`: PlaceholderAPI either doesn't support a specific Server Type/Version or has conflicts with another plugin. + multiple: false + options: + - "Plugin Bug" + - "API Bug" + - "Plugin/Server Incompatability" + validations: + required: true +- type: textarea + attributes: + label: "What happens?" + description: "What bug are you encountering? Try to explain it as detailed as possible." + placeholder: "PlaceholderAPI does this when I do that..." + validations: + required: true +- type: textarea + attributes: + label: "Expected Behaviour" + description: "What behaviour did you expect from PlaceholderAPI?" + placeholder: "PlaceholderAPI should actually do..." + validations: + required: true +- type: textarea + attributes: + label: "How to Reproduce" + description: |- + List the steps on how to reproduce this Bug. + Post any Code-examples in the `Additional Information` field below when you selected `API Bug`. + placeholder: |- + 1. Do this + 2. ... + 3. Profit! + validations: + required: true +- type: input + id: "dump" + attributes: + label: "`/papi dump` Output" + description: |- + Please execute the `/papi dump` command and provide the generated URL from it. + If you can't execute the command (i.e. PlaceholderAPI doesn't start up) can you put N/A here and mention the issue in the `Additional Information` field. + placeholder: "https://paste.helpch.at/dump.log" + validations: + required: true +- type: input + id: "console" + attributes: + label: "Console Log" + description: |- + Get the latest content of your `latest.log` file an upload it to https://paste.helpch.at + Take the generated URL and paste it into this field. + placeholder: "https://paste.helpch.at/latest.log" +- type: input + id: "error" + attributes: + label: "Errors" + description: |- + Upload any errors you find to https://paste.helpch.at and post the link in the field below. + placeholder: "https://paste.helpch.at/error.log" +- type: textarea + attributes: + label: "Additional Info" + description: |- + Add any extra info you think is nessesary for this Bug report. + - If you selected `API Bug` will you need to include code-examples here to reproduce the issue. + - If you selected `Plugin/Server Incompatability` should you include extra Server info such as a Timings or Spark-Report or info about the plugin in question. + placeholder: "Put any extra info you like into this field..." diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index c66b3e4..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -name: Feature Request -about: Request a update/change of the PlaceholderAPI-code - ---- - - - -## Feature Request - -### Type - - - -- [ ] 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: __________ - -### Description - - diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..d6f6087 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,62 @@ +name: Feature Request +description: Suggest a new Feature for PlaceholderAPI +labels: +- "Type: Enhancement" +body: +- type: markdown + attributes: + value: |- + Thank you for taking the time in creating this Feature Request. + In order to process your feature request as fast and efficiently as possible do we ask you to fill out any required fields (Indicated with a red asterisk (`*`)) with the requested information. + + If you have any further questions should you either [join our Discord Server](https://helpch.at/discord) or [ask in our Discussions](https://github.com/PlaceholderAPI/PlaceholderAPI/discussions). +- type: checkboxes + attributes: + label: Confirmation + description: Please make sure to have followed the following checks. + options: + - label: I checked the Issues and Pull request tab for any existing issues or PRs. + required: true + - label: My Feature Request is for **PlaceholderAPI** and not any expansion or other plugin. + required: true +- type: dropdown + attributes: + label: "Type" + description: "What type is your Suggestion? Select all that match." + multiple: true + options: + - "New API feature" + - "New config option" + - "Minor Code improvement (Won't affect Servers)" + - "Major Code improvement (Will affect Servers)" + validations: + required: true +- type: textarea + attributes: + label: "Description" + description: |- + Give a detailed explanation about your Feature request and why it would be beneficial for PlaceholderAPI. + Just saying "It's cool!" or "I need it" don't count as valid reasons. It needs to have a clear benefit for **other** players too. + validations: + required: true +- type: textarea + attributes: + label: "Code Example" + description: |- + Do you have any Code Snippets that you want to share with us? Paste it here! + Note that the input will automatically be rendered as Java code, so you won't need to put it into a code block yourself. + render: java +- type: input + attributes: + label: "Jar file" + description: |- + If you already have a PlaceholderAPI Jar with the requested changes would we love to get a download link for it. + If you don't have a download link can you leave this field empty or provide "N/A" as a response. + placeholder: "https://cdn.discordapp.com/..." +- type: textarea + attributes: + label: "Additional Information" + description: |- + Add any extra info you think is nessesary for this Feature request. + - When you selected `Major Code improvement (Will affect Servers)` should you mention what will break when people update. + placeholder: "Put any extra info you like into this field..." diff --git a/README.md b/README.md index a6c7930..2ea8404 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,9 @@ [APIversionImg]: https://img.shields.io/nexus/placeholderapi/me.clip/placeholderapi?server=https%3A%2F%2Frepo.extendedclip.com&label=API%20Version [logo]: https://i.imgur.com/Ea4PURv.png + +[contributing]: https://github.com/PlaceholderAPI/PlaceholderAPI/blob/master/.github/CONTRIBUTING.md +[placeholderexpansion]: https://github.com/PlaceholderAPI/PlaceholderAPI/wiki/PlaceholderExpansion [![logo]][spigot] @@ -29,8 +32,11 @@ Support for specific plugins are provided either by the plugin itself or through PlaceholderAPI has been downloaded over 500,000 times and has been used concurrently on over 20,000 servers, which makes it a must-have for a server of any type or scale. - - +## Contribute +If you would like to contribute towards PlaceholderAPI should you take a look at our [Contributing file][contributing] for the ins and outs on how you can do that and what you need to keep in mind. + +## Create an Expansion +If you would like to create your own Placeholder Expansion for PlaceholderAPI, take a look at our [Wiki][placeholderexpansion] which contains a detailed tutorial on how you can achieve this. ## Support - [Issue Tracker][issues] diff --git a/build.gradle b/build.gradle index b1c6b8a..f38ba27 100644 --- a/build.gradle +++ b/build.gradle @@ -3,8 +3,8 @@ import org.apache.tools.ant.filters.ReplaceTokens plugins { id "java" id "maven-publish" - id "net.minecrell.licenser" version "0.4.1" - id "com.github.johnrengelman.shadow" version "6.0.0" + id "org.cadixdev.licenser" version "0.6.0" + id "com.github.johnrengelman.shadow" version "7.0.0" } group "me.clip" @@ -20,22 +20,21 @@ repositories { } dependencies { - implementation "org.bstats:bstats-bukkit:1.5" + implementation "com.google.code.gson:gson:2.8.6" + implementation "org.bstats:bstats-bukkit:2.2.1" - compileOnly "org.spigotmc:spigot-api:1.16.4-R0.1-SNAPSHOT" + compileOnly "org.spigotmc:spigot-api:1.17-R0.1-SNAPSHOT" compileOnly "org.jetbrains:annotations:19.0.0" testImplementation "org.openjdk.jmh:jmh-core:1.23" testImplementation "org.openjdk.jmh:jmh-generator-annprocess:1.23" - testCompile "org.junit.jupiter:junit-jupiter-engine:5.6.2" - testRuntime "org.junit.jupiter:junit-jupiter-engine:5.6.2" + testImplementation "org.junit.jupiter:junit-jupiter-engine:5.6.2" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.6.2" } processResources { - from(sourceSets.main.resources.srcDirs) { - filter ReplaceTokens, tokens: [name: rootProject.name, version: project.version.toString(), description: project.description] - } + filter ReplaceTokens, tokens: [name: rootProject.name, version: project.version.toString(), description: project.description] } java { @@ -83,9 +82,10 @@ test { useJUnitPlatform() } -sourceSets { - test.compileClasspath += configurations.compileOnly - test.runtimeClasspath += configurations.compileOnly +configurations { + testImplementation { + extendsFrom(compileOnly) + } } publishing { diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 62d4c05..e708b1c 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index c78a2b9..0f80bbf 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Tue Jul 14 23:27:02 AWST 2020 -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index fbd7c51..4f906e0 100644 --- a/gradlew +++ b/gradlew @@ -130,7 +130,7 @@ fi if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - + JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath diff --git a/gradlew.bat b/gradlew.bat index 5093609..107acd3 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if "%ERRORLEVEL%" == "0" goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -54,7 +54,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -64,21 +64,6 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - :execute @rem Setup the command line @@ -86,7 +71,7 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell diff --git a/src/main/java/me/clip/placeholderapi/PlaceholderAPIPlugin.java b/src/main/java/me/clip/placeholderapi/PlaceholderAPIPlugin.java index 7472076..094bddf 100644 --- a/src/main/java/me/clip/placeholderapi/PlaceholderAPIPlugin.java +++ b/src/main/java/me/clip/placeholderapi/PlaceholderAPIPlugin.java @@ -33,6 +33,8 @@ import me.clip.placeholderapi.expansion.manager.LocalExpansionManager; import me.clip.placeholderapi.listeners.ServerLoadEventListener; import me.clip.placeholderapi.updatechecker.UpdateChecker; import org.bstats.bukkit.Metrics; +import org.bstats.charts.AdvancedPie; +import org.bstats.charts.SimplePie; import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.bukkit.command.PluginCommand; @@ -205,14 +207,13 @@ public final class PlaceholderAPIPlugin extends JavaPlugin { } private void setupMetrics() { - final Metrics metrics = new Metrics(this); - metrics.addCustomChart(new Metrics.SimplePie("using_expansion_cloud", + final Metrics metrics = new Metrics(this, 438); + metrics.addCustomChart(new SimplePie("using_expansion_cloud", () -> getPlaceholderAPIConfig().isCloudEnabled() ? "yes" : "no")); - metrics.addCustomChart( - new Metrics.SimplePie("using_spigot", () -> getServerVersion().isSpigot() ? "yes" : "no")); + metrics.addCustomChart(new SimplePie("using_spigot", () -> getServerVersion().isSpigot() ? "yes" : "no")); - metrics.addCustomChart(new Metrics.AdvancedPie("expansions_used", () -> { + metrics.addCustomChart(new AdvancedPie("expansions_used", () -> { final Map values = new HashMap<>(); for (final PlaceholderExpansion expansion : getLocalExpansionManager().getExpansions()) {