Skip to content

Commit ea0c5b8

Browse files
authored
Some tweaks for release (#1)
* Some tweaks for release This changes a few things to polish up the release. - Bump copyright year since changes are being made to the code this year - Add a proper readme with usage instructions - Instead of specifying paper version 1.19.4, we tell the user to check the plugin page for the right version to upgrade to, since the new plugin system has been around for a while and a lot of plugins probably won't support 1.19 any more. * Readme wording changes
1 parent 911e47d commit ea0c5b8

File tree

3 files changed

+47
-3
lines changed

3 files changed

+47
-3
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 PaperMC
3+
Copyright (c) 2024 PaperMC
44
Contributors
55

66
Permission is hereby granted, free of charge, to any person obtaining a copy

README.md

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Paper Trail
2+
3+
**Paper Trail** is a helper library for
4+
notifying users of legacy server software
5+
that a plugin requires Paper.
6+
The main use case for this library
7+
is for plugins that utilize the new
8+
Paper plugin system (`paper-plugin.yml`)
9+
and do not support the legacy plugin system
10+
(`plugin.yml`).
11+
12+
Paper Trail offers a simple way to notify users
13+
that they need to upgrade to Paper by providing
14+
a stub `JavaPlugin` that prints a helpful message
15+
on startup and then disables itself.
16+
An alternate message is used if the server is
17+
running Paper, but the version is too old to
18+
support the Paper plugin system.
19+
20+
### How to Use
21+
22+
Add the PaperMC repository (`https://repo.papermc.io/repository/maven-public/`) to your build script
23+
and shade `io.papermc:paper-trail:0.0.1-SNAPSHOT`
24+
into your plugin.
25+
It is recommended to relocate the `io.papermc.papertrail`
26+
package to avoid conflicts.
27+
28+
To use Paper Trail, add a
29+
`plugin.yml` to your plugin with
30+
`io.papermc.papertrail.RequiresPaperPlugins`
31+
as the "main" class.
32+
If you relocated the package, be sure to adjust
33+
the class name in the yaml accordingly.
34+
35+
### License
36+
37+
Paper Trail is licensed under the MIT License.
38+
See the [LICENSE](LICENSE) file for more information.

src/main/java/io/papermc/papertrail/RequiresPaperPlugins.java

+8-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ private void printInformation() {
2121
final List<String> lines = new ArrayList<>(Arrays.asList("", Util.EQUALS_LINE));
2222
lines.addAll(Util.PAPER ? this.outdatedPaper() : this.requiresPaper());
2323
lines.add(Util.EQUALS_LINE);
24-
this.getLogger().log(Level.SEVERE, String.join("\n", lines), new UnsupportedPlatformException("Unsupported platform"));
24+
this.getLogger().log(Level.SEVERE, String.join("\n", lines),
25+
new UnsupportedPlatformException("Unsupported platform"));
2526
}
2627

2728
private void disable() {
@@ -30,7 +31,12 @@ private void disable() {
3031

3132
private List<String> outdatedPaper() {
3233
final String pluginName = this.getDescription().getName();
33-
return Arrays.asList(" " + pluginName + " requires Paper 1.19.4 or newer.");
34+
return Arrays.asList(
35+
" " + pluginName + " requires a newer version of Paper.",
36+
" You can often find a list of supported game versions",
37+
" at the webpage you obtained the plugin from. You could",
38+
" also contact the plugin author for assistance."
39+
);
3440
}
3541

3642
private List<String> requiresPaper() {

0 commit comments

Comments
 (0)