Skip to content

Commit f950a8f

Browse files
committed
Modernize PluginVersions Paper build
1 parent d314c06 commit f950a8f

16 files changed

Lines changed: 2179 additions & 363 deletions

File tree

.gitignore

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Created by https://www.gitignore.io/api/maven,eclipse,intellij,netbeans,osx,windows,notepadpp,windows,java
22

3+
# Local Paper test servers and generated runtime data
4+
/servers/
5+
36
### Maven ###
47
target/
58
pom.xml.tag
@@ -11,6 +14,13 @@ dependency-reduced-pom.xml
1114
buildNumber.properties
1215
.mvn/timing.properties
1316

17+
### Gradle ###
18+
.gradle/
19+
build/
20+
builds/
21+
out/
22+
!gradle/wrapper/gradle-wrapper.jar
23+
1424

1525
### Eclipse ###
1626

@@ -84,6 +94,9 @@ nbactions.xml
8494

8595
### OSX ###
8696
.DS_Store
97+
.ds_store
98+
**/.DS_Store
99+
**/.ds_store
87100
.AppleDouble
88101
.LSOverride
89102

@@ -133,6 +146,7 @@ $RECYCLE.BIN/
133146

134147
### Java ###
135148
*.class
149+
*.log
136150

137151
# Mobile Tools for Java (J2ME)
138152
.mtj.tmp/
@@ -142,4 +156,4 @@ $RECYCLE.BIN/
142156
*.ear
143157

144158
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
145-
hs_err_pid*
159+
hs_err_pid*

README.md

Lines changed: 97 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,110 @@
11
# PluginVersions &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="https://hangar.papermc.io/SlimeDog/PluginVersions">![download-on-hangar](https://user-images.githubusercontent.com/17748923/187102194-00e910e6-ee8e-42cb-bfe1-d2f9e657ef4b.png)</a> <a href="https://www.spigotmc.org/resources/70927/">![download-on-spigot](https://user-images.githubusercontent.com/17748923/187102011-b72e0f1d-ba74-4cb2-a69e-46f48cb364b5.png)</a>
22

3-
Create an alphabetically-sorted list of loaded plugins and versions.
3+
PluginVersions creates an alphabetically sorted list of loaded plugins and their versions. This 1MB update also keeps a human-readable plugin inventory database, lets you curate plugin URLs over time, and exports Markdown reports for GitHub, Discord, or server documentation.
44

5-
### Tested Environments
5+
## Tested Environment
66

7-
**PluginVersions** was originally written for Spigot 1.8.8, and has worked for every Spigot version since then.
7+
This Paper build targets PaperMC `26.1.2` (`paper-api:26.1.2.build.20-alpha`) and compiles with Java 25. The plugin uses `api-version: 1.21.11` and reports version `2.0.0`.
88

9-
All commands may be executed at the console, and in-game with appropriate permissions.
9+
The plugin data folder is `plugins/1MB-PluginVersions/`.
1010

11-
### Commands
11+
The only root command is `/pv`. The long `/pluginversions` command is not registered; the namespaced command remains available as `pluginversions:pv`.
1212

13-
> _pluginversions list_
14-
> Create an alphabetically-sorted columnar list of plugins and versions.
15-
>
16-
> _pluginversions reload_
17-
> Reload configuration file.
18-
> At present, the only configuration option is whether to send metrics to MCStats.org.
13+
All commands can be executed from the console. In-game use requires the matching permission.
1914

20-
### Command aliases
15+
## Build
2116

22-
- pv :: Spigot, Paper
23-
- pvb :: BungeeCord, Waterfall
24-
- pvv :: Velocity
17+
```bash
18+
gradle clean build
19+
```
2520

26-
### Permissions
21+
The compiled jar is written to `builds/libs/1MB-PluginVersions-v2.0.0-003-j25-26.1.2.jar`.
2722

28-
Permissions reflect the commands they allow. All permissions default to op.
23+
## Commands
2924

30-
> _pluginversions.list_
25+
| Command | Description |
26+
| --- | --- |
27+
| `/pv help [page\|topic]` | Shows help pages. |
28+
| `/pv list [page]` | Lists loaded plugins and versions. Without a page, it lists every loaded plugin. |
29+
| `/pv reload` | Reloads `config.yml` and the active translation file. |
30+
| `/pv debug [page\|topic]` | Shows status, plugin details, server details, counts, commands, permissions, placeholders, config, set, and URL pages. |
31+
| `/pv debug url add <plugin> <url>` | Stores a manual URL and infers the URL type. |
32+
| `/pv debug url add <plugin> <type> <url>` | Stores a manual URL with a custom type such as `source`, `docs`, or `download`. |
33+
| `/pv debug url del <plugin> [type] <url>` | Removes a stored manual URL. |
34+
| `/pv debug url list <plugin>` | Lists manual URLs stored for a plugin. |
35+
| `/pv debug url audit [page]` | Shows URL coverage for tracked plugins. |
36+
| `/pv config [page]` | Shows active configuration values. |
37+
| `/pv set <path> <value>` | Updates a known `config.yml` setting, saves it, and reloads the plugin settings. Filesystem paths are console-only. |
38+
| `/pv export [markdown\|discord]` | Updates the database and writes timestamped plus stable latest export files. |
3139

32-
> _pluginversions.reload_
40+
## Permissions
41+
42+
All permissions except `pluginversions.help` default to op.
43+
44+
| Permission | Description |
45+
| --- | --- |
46+
| `pluginversions.*` | Grants every PluginVersions command and URL action. |
47+
| `pluginversions.help` | Allows access to help pages. |
48+
| `pluginversions.list` | Allows listing loaded plugins. |
49+
| `pluginversions.reload` | Allows reloading config and translations. |
50+
| `pluginversions.debug` | Allows viewing debug pages. |
51+
| `pluginversions.config` | Allows viewing active config values. |
52+
| `pluginversions.set` | Allows changing known config values. |
53+
| `pluginversions.export` | Allows exporting plugin inventory reports. |
54+
| `pluginversions.url.*` | Grants all manual URL database actions. |
55+
| `pluginversions.url.list` | Allows listing and auditing URL entries. |
56+
| `pluginversions.url.add` | Allows adding manual URL entries. |
57+
| `pluginversions.url.del` | Allows removing manual URL entries. |
58+
59+
## Placeholders
60+
61+
Language phrases live in `translations/Locale_EN.yml` and use MiniMessage. Legacy ampersand color codes are migrated at runtime if older values are found, but new phrases should use MiniMessage tags.
62+
63+
Language tokens include `{name}`, `{display-name}`, `{internal-name}`, `{version}`, `{spacing}`, `{page}`, `{pages}`, `{count}`, `{enabled}`, and `{disabled}`.
64+
65+
If PlaceholderAPI is installed, PluginVersions registers these placeholders:
66+
67+
| Placeholder | Result |
68+
| --- | --- |
69+
| `%pluginversions_total%` | Loaded plugin count. |
70+
| `%pluginversions_enabled%` | Enabled plugin count. |
71+
| `%pluginversions_disabled%` | Disabled plugin count. |
72+
| `%pluginversions_database_tracked%` | Plugins currently tracked in the inventory database. |
73+
| `%pluginversions_version_<plugin>%` | Version for a loaded plugin. |
74+
| `%pluginversions_url_<plugin>_<type>%` | First matching detected or manual URL for a plugin and type. |
75+
76+
## Configuration
77+
78+
`config.yml` contains only operational settings and is fully commented. Player-facing phrases, command text, colors, and placeholders are kept in `translations/Locale_EN.yml`.
79+
80+
Anonymous metrics are disabled by default with `settings.enable-metrics: false`.
81+
82+
Update checks are disabled by default with `check-for-updates: false`.
83+
84+
The YAML database is stored at `plugins/1MB-PluginVersions/plugins-database.yml` by default. It tracks each plugin's display name, internal name, version, enabled state, description, authors, contributors, dependencies, provided plugins, website, detected URLs, manual URLs, and scan history.
85+
86+
`database.file` and `exports.directory` are filesystem paths and can only be changed from the console or by editing `config.yml`.
87+
88+
## URL Database
89+
90+
Detected URLs come from plugin metadata such as website and description fields. Manual URLs are stored under `manual-urls` and are merged with detected URLs in exports.
91+
92+
Known inferred URL types include `github`, `jenkins`, `modrinth`, `hangar`, `spigot`, `dev-bukkit`, `ci`, and `website`. You can also provide your own type:
93+
94+
```text
95+
/pv debug url add LuckPerms source https://github.com/LuckPerms/LuckPerms
96+
/pv debug url add LuckPerms download https://modrinth.com/plugin/luckperms
97+
```
98+
99+
## Exports
100+
101+
Exports are written to `plugins/1MB-PluginVersions/exports/` by default.
102+
103+
| Command | Files |
104+
| --- | --- |
105+
| `/pv export markdown` | `plugins-YYYY-MM-DD-HHMMSS.md` and `plugins-latest.md` |
106+
| `/pv export discord` | `plugins-discord-YYYY-MM-DD-HHMMSS.md` and `plugins-discord-latest.md` |
107+
108+
## Credits
109+
110+
PluginVersions credits mart-r, GabrielHD150, SlimeDog, and mrfloris as authors. Updates in this branch include implementation help from OpenAI.

build.gradle.kts

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
plugins {
2+
java
3+
}
4+
5+
group = "com.straight8.rambeau"
6+
version = "2.0.0"
7+
description = "List installed plugins and versions alphabetically"
8+
9+
val buildNumber = "003"
10+
val javaTarget = "25"
11+
val paperTarget = "26.1.2"
12+
13+
repositories {
14+
mavenCentral()
15+
maven("https://repo.papermc.io/repository/maven-public/")
16+
maven("https://repo.extendedclip.com/releases/")
17+
}
18+
19+
dependencies {
20+
compileOnly("io.papermc.paper:paper-api:26.1.2.build.20-alpha")
21+
compileOnly("net.kyori:adventure-text-minimessage:4.26.1")
22+
compileOnly("net.kyori:adventure-text-serializer-legacy:4.26.1")
23+
compileOnly("me.clip:placeholderapi:2.12.2")
24+
}
25+
26+
java {
27+
toolchain {
28+
languageVersion.set(JavaLanguageVersion.of(25))
29+
}
30+
sourceCompatibility = JavaVersion.VERSION_25
31+
targetCompatibility = JavaVersion.VERSION_25
32+
}
33+
34+
tasks.withType<JavaCompile>().configureEach {
35+
options.encoding = "UTF-8"
36+
options.release.set(25)
37+
options.compilerArgs.addAll(listOf("-Xlint:deprecation", "-Xdiags:verbose"))
38+
}
39+
40+
tasks.processResources {
41+
filteringCharset = "UTF-8"
42+
val props = mapOf(
43+
"version" to project.version,
44+
"description" to project.description,
45+
)
46+
inputs.properties(props)
47+
filesMatching("plugin.yml") {
48+
expand(props)
49+
}
50+
}
51+
52+
tasks.jar {
53+
archiveFileName.set("1MB-PluginVersions-v${project.version}-$buildNumber-j$javaTarget-$paperTarget.jar")
54+
destinationDirectory.set(layout.projectDirectory.dir("builds/libs"))
55+
}
56+
57+
tasks.clean {
58+
delete(layout.projectDirectory.dir("builds"))
59+
}

pom.xml

Lines changed: 25 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
1-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
1+
<project xmlns="http://maven.apache.org/POM/4.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
34
<modelVersion>4.0.0</modelVersion>
5+
46
<groupId>com.straight8.rambeau</groupId>
5-
<artifactId>PluginVersions</artifactId>
6-
<version>1.3.6</version>
7-
<name>PluginVersions</name>
7+
<artifactId>1MB-PluginVersions</artifactId>
8+
<version>2.0.0</version>
9+
<name>1MB-PluginVersions</name>
810
<description>List installed plugins and versions alphabetically</description>
911

1012
<properties>
11-
<maven.compiler.source>25</maven.compiler.source>
12-
<maven.compiler.target>25</maven.compiler.target>
13+
<maven.compiler.release>25</maven.compiler.release>
1314
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15+
<paper.api.version>26.1.2.build.20-alpha</paper.api.version>
16+
<adventure.version>4.26.1</adventure.version>
17+
<placeholderapi.version>2.12.2</placeholderapi.version>
18+
<build.number>003</build.number>
1419
</properties>
1520

1621
<repositories>
@@ -19,113 +24,59 @@
1924
<url>https://repo.papermc.io/repository/maven-public/</url>
2025
</repository>
2126
<repository>
22-
<id>jitpack.io</id>
23-
<url>https://jitpack.io</url>
27+
<id>extendedclip</id>
28+
<url>https://repo.extendedclip.com/releases/</url>
2429
</repository>
2530
</repositories>
2631

2732
<dependencies>
2833
<dependency>
2934
<groupId>io.papermc.paper</groupId>
3035
<artifactId>paper-api</artifactId>
31-
<version>1.21.11-R0.1-SNAPSHOT</version>
36+
<version>${paper.api.version}</version>
3237
<scope>provided</scope>
3338
</dependency>
34-
<dependency>
35-
<groupId>com.github.SlimeDog</groupId>
36-
<artifactId>SlimeDogCore</artifactId>
37-
<version>1.0.10</version>
38-
</dependency>
3939
<dependency>
4040
<groupId>net.kyori</groupId>
41-
<artifactId>adventure-text-serializer-legacy</artifactId>
42-
<version>4.26.1</version>
41+
<artifactId>adventure-text-minimessage</artifactId>
42+
<version>${adventure.version}</version>
4343
<scope>provided</scope>
4444
</dependency>
4545
<dependency>
4646
<groupId>net.kyori</groupId>
47-
<artifactId>adventure-api</artifactId>
48-
<version>4.26.1</version>
47+
<artifactId>adventure-text-serializer-legacy</artifactId>
48+
<version>${adventure.version}</version>
4949
<scope>provided</scope>
5050
</dependency>
5151
<dependency>
52-
<groupId>org.jspecify</groupId>
53-
<artifactId>jspecify</artifactId>
54-
<version>1.0.0</version>
52+
<groupId>me.clip</groupId>
53+
<artifactId>placeholderapi</artifactId>
54+
<version>${placeholderapi.version}</version>
55+
<scope>provided</scope>
5556
</dependency>
5657
</dependencies>
5758

5859
<build>
59-
<finalName>PluginVersions-${project.version}</finalName>
60+
<finalName>1MB-PluginVersions-v${project.version}-${build.number}-j25-26.1.2</finalName>
6061
<resources>
6162
<resource>
6263
<directory>src/main/resources</directory>
6364
<filtering>true</filtering>
6465
</resource>
6566
</resources>
6667
<plugins>
67-
<plugin>
68-
<groupId>org.apache.maven.plugins</groupId>
69-
<artifactId>maven-dependency-plugin</artifactId>
70-
<version>3.9.0</version>
71-
</plugin>
7268
<plugin>
7369
<groupId>org.apache.maven.plugins</groupId>
7470
<artifactId>maven-compiler-plugin</artifactId>
7571
<version>3.14.1</version>
7672
<configuration>
73+
<release>${maven.compiler.release}</release>
7774
<compilerArgs>
7875
<arg>-Xlint:deprecation</arg>
79-
<arg>-Xlint:-options</arg>
8076
<arg>-Xdiags:verbose</arg>
8177
</compilerArgs>
8278
</configuration>
8379
</plugin>
84-
<plugin>
85-
<groupId>org.apache.maven.plugins</groupId>
86-
<artifactId>maven-shade-plugin</artifactId>
87-
<version>3.6.1</version>
88-
<executions>
89-
<execution>
90-
<phase>package</phase>
91-
<goals>
92-
<goal>shade</goal>
93-
</goals>
94-
<configuration>
95-
<createDependencyReducedPom>false</createDependencyReducedPom>
96-
<minimizeJar>true</minimizeJar>
97-
<transformers>
98-
<transformer
99-
implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer">
100-
</transformer>
101-
</transformers>
102-
<filters>
103-
<filter>
104-
<artifact>*:*</artifact>
105-
<excludes>
106-
<exclude>META-INF/maven/**</exclude>
107-
<exclude>META-INF/*.MF</exclude>
108-
<exclude>META-INF/*.SF</exclude>
109-
<exclude>META-INF/*.DSA</exclude>
110-
<exclude>META-INF/*.RSA</exclude>
111-
<exclude>META-INF/services/**</exclude>
112-
<exclude>META-INF/versions/**</exclude>
113-
<exclude>org/jetbrains/**</exclude>
114-
<exclude>org/intellij/**</exclude>
115-
<exclude>org/jspecify/**</exclude>
116-
</excludes>
117-
</filter>
118-
</filters>
119-
<relocations>
120-
<relocation>
121-
<pattern>dev.ratas.slimedogcore</pattern>
122-
<shadedPattern>${project.groupId}.${project.artifactId}.core</shadedPattern>
123-
</relocation>
124-
</relocations>
125-
</configuration>
126-
</execution>
127-
</executions>
128-
</plugin>
12980
</plugins>
13081
</build>
13182
</project>

settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rootProject.name = "1MB-PluginVersions"

0 commit comments

Comments
 (0)