From b59ad6d299b94d7b1534d3a98b6fbe433202d76b Mon Sep 17 00:00:00 2001 From: Athar42 Date: Thu, 23 Apr 2026 00:04:49 +0200 Subject: [PATCH] - Officially support PaperMC forks now (even if it was already working on them with prior releases :P ) - Update to Java 25 - Update Gradle to 9.4.1 - Update Shadow to 9.4.1 - Update PacketEvents API to 2.12.1 - Update CommandAPI to 11.2.0 --- build.gradle | 8 +++--- gradle.properties | 8 +++--- gradle/wrapper/gradle-wrapper.properties | 4 +-- readme.md | 21 ++++++++++----- .../utils/ServerVersionChecker.java | 26 ++++++++++++++----- 5 files changed, 44 insertions(+), 23 deletions(-) diff --git a/build.gradle b/build.gradle index 0d839ad..b923054 100644 --- a/build.gradle +++ b/build.gradle @@ -1,11 +1,11 @@ plugins { id 'java' - id "com.gradleup.shadow" version "9.3.2" + id "com.gradleup.shadow" version "9.4.1" } java { - sourceCompatibility = JavaVersion.VERSION_21 - targetCompatibility = JavaVersion.VERSION_21 + sourceCompatibility = JavaVersion.VERSION_25 + targetCompatibility = JavaVersion.VERSION_25 } base { @@ -42,7 +42,7 @@ dependencies { implementation "de.maxhenkel.voicechat:voicechat-api:${voicechat_api_version}" shadow "dev.jorel:commandapi-paper-shade:${command_api_version}" - compileOnly "com.github.retrooper:packetevents-spigot:2.11.2" + compileOnly "com.github.retrooper:packetevents-spigot:2.12.1" } repositories { diff --git a/gradle.properties b/gradle.properties index 86fcf9d..cd01363 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,14 +3,14 @@ org.gradle.jvmargs=-Xmx2G mp3spi_version=1.9.5.4 -bukkit_api_version=1.21 -bukkit_version=1.21.11-R0.1-SNAPSHOT +bukkit_api_version=26.1.2 +bukkit_version=26.1.2.build.+ mod_id=customdiscsplugin # Target an older API to make it compatible with older versions of Simple Voice Chat voicechat_api_version=2.6.0 -command_api_version=11.1.0 +command_api_version=11.2.0 -plugin_version=5.3.0 +plugin_version=6.0.0 maven_group=me.Navoei.customdiscsplugin archives_base_name=custom-discs \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 23449a2..56ddc0f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists +zipStorePath=wrapper/dists \ No newline at end of file diff --git a/readme.md b/readme.md index c3b22b1..e01c188 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,6 @@ -# Custom Discs v5.3.0 -### For Paper and Folia -### 1.21.7 to 1.21.11 +# Custom Discs v6.0.0 +### For Paper, Folia and Forks (Purpur, Leaf, ...) +### 1.21.7 to 26.1.2 [![GitHub Total Downloads](https://img.shields.io/github/downloads/Navoei/CustomDiscs/total?style=plastic&label=GitHub%20Downloads&color=success "Click here to download the plugin")](https://modrinth.com/plugin/customdiscs-plugin)       [![Modrinth Downloads](https://img.shields.io/modrinth/dt/customdiscs-plugin?style=plastic&label=Modrinth%20Downloads&color=success "Click here to download the plugin")](https://modrinth.com/plugin/customdiscs-plugin) @@ -11,10 +11,16 @@ **Since version 5.2.0, [PacketEvents](https://modrinth.com/plugin/packetevents) (v2.11.2+) is required.**\ ProtocolLib is no longer used — it can be safely removed if no other plugin needs it. +## ⚠️ Java 25 required + +**Starting with version 6.0.0, this plugin requires Java 25 or newer to run on your server.** + --- A Paper fork of henkelmax's Audio Player. Special thanks to Athar42 for maintaining this plugin. +> Any Paper forks should be supported. In case of issues, reach us on our [Discord server](https://discord.gg/rJtBRmRFCr). + Play custom music discs, goat horns and player heads using the [Simple Voice Chat](https://modrinth.com/plugin/simple-voice-chat) API. > The Simple Voice Chat mod is required on both the client and the server. @@ -269,7 +275,7 @@ update-available: '&eA new version of CustomDiscs is available: &6%latest_versio ## Version Support Matrix -| Minecraft version | Paper | Folia | +| Minecraft version | Paper & Forks (Purpur, Leaf, ...) | Folia & Forks | |------------------------------------|-------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------| | **1.19** | 1.1.0 – [2.1](https://github.com/Navoei/CustomDiscs/releases/tag/v2.1) | — | | **1.19.1, 1.19.2, 1.19.3** | 2.2 – [2.2.3](https://github.com/Navoei/CustomDiscs/releases/tag/v2.2.3) | — | @@ -282,9 +288,10 @@ update-available: '&eA new version of CustomDiscs is available: &6%latest_versio | **1.21.4** | 4.2 – [4.4](https://github.com/Navoei/CustomDiscs/releases/tag/v4.4) | — | | **1.21.5** | [4.4](https://github.com/Navoei/CustomDiscs/releases/tag/v4.4) | — | | **1.21.6, 1.21.7-8** | [4.5](https://github.com/Navoei/CustomDiscs/releases/tag/v4.5) | — | -| **1.21.7-9, 1.21.8** | 5.0 – [5.3.0](https://modrinth.com/plugin/customdiscs-plugin/version/5.3.0) | (only since 1.21.8) 5.1.1 – [5.3.0](https://modrinth.com/plugin/customdiscs-plugin/version/5.3.0) | -| **1.21.9, 1.21.10** | 5.1.2 – [5.3.0](https://modrinth.com/plugin/customdiscs-plugin/version/5.3.0) | 5.1.2 – [5.3.0](https://modrinth.com/plugin/customdiscs-plugin/version/5.3.0) | -| **1.21.11** | 5.1.3 – [5.3.0](https://modrinth.com/plugin/customdiscs-plugin/version/5.3.0) | 5.1.3 – [5.3.0](https://modrinth.com/plugin/customdiscs-plugin/version/5.3.0) | +| **1.21.7-9, 1.21.8** | 5.0 – [6.0.0](https://modrinth.com/plugin/customdiscs-plugin/version/6.0.0) | (only since 1.21.8) 5.1.1 – [6.0.0](https://modrinth.com/plugin/customdiscs-plugin/version/6.0.0) | +| **1.21.9, 1.21.10** | 5.1.2 – [6.0.0](https://modrinth.com/plugin/customdiscs-plugin/version/6.0.0) | 5.1.2 – [6.0.0](https://modrinth.com/plugin/customdiscs-plugin/version/6.0.0) | +| **1.21.11** | 5.1.3 – [6.0.0](https://modrinth.com/plugin/customdiscs-plugin/version/6.0.0) | 5.1.3 – [6.0.0](https://modrinth.com/plugin/customdiscs-plugin/version/6.0.0) | +| **26.1, 26.1.1, 26.1.2** | [6.0.0](https://modrinth.com/plugin/customdiscs-plugin/version/6.0.0) | [6.0.0](https://modrinth.com/plugin/customdiscs-plugin/version/6.0.0) | --- diff --git a/src/main/java/me/Navoei/customdiscsplugin/utils/ServerVersionChecker.java b/src/main/java/me/Navoei/customdiscsplugin/utils/ServerVersionChecker.java index b6b5c72..9db28ca 100644 --- a/src/main/java/me/Navoei/customdiscsplugin/utils/ServerVersionChecker.java +++ b/src/main/java/me/Navoei/customdiscsplugin/utils/ServerVersionChecker.java @@ -4,14 +4,14 @@ import org.bukkit.Bukkit; import org.bukkit.plugin.java.JavaPlugin; - import java.util.logging.Logger; import java.util.regex.Matcher; import java.util.regex.Pattern; public class ServerVersionChecker { - private static final String REQUIRED_PAPER_VERSION = "1.21.7-9"; // Set the PaperMC required version - private static final String REQUIRED_FOLIA_VERSION = "1.21.8-2"; // Set the Folia required version + private static final String REQUIRED_PAPER_VERSION = "1.21.7-9"; // Set the PaperMC minimal required version + private static final String REQUIRED_FOLIA_VERSION = "1.21.8-2"; // Set the Folia minimal required version + private static final String REQUIRED_PAPER_FORK_VERSION = "1.21.7"; // Set the Paper API's fork minimal required version private final Logger pluginLogger; public static boolean paperAPIcheck; @@ -68,8 +68,22 @@ public void checkVersion() { paperAPIcheck = true; } else { - // For Paper forks servers (mostly), log a severe message about non-support - pluginLogger.severe(serverType + " server detected. No support will be provided!"); + // Testing if the standard PaperAPI class exist : If true it's a fork + try { + Class.forName("io.papermc.paper.ServerBuildInfo"); + + paperAPIcheck = true; + + // We only check the MC base version for compatibility as we can't rely on full build number + String cleanVersionNoPatch = buildVersion.split("-")[0]; + if (compareVersionParts(cleanVersionNoPatch, REQUIRED_PAPER_FORK_VERSION) < 0) { + pluginLogger.severe(serverType + " (Paper fork) server version is unsupported. Please update to at least Minecraft release " + REQUIRED_PAPER_FORK_VERSION); + } + + } catch (ClassNotFoundException ignored) { + // If not a Paper fork (no Paper API detected) we issue a severe message about non-support + pluginLogger.severe(serverType + " server detected. No support will be provided!"); + } } } else { pluginLogger.severe("Unable to read the server version. Is this a supported PaperMC release?"); @@ -121,7 +135,7 @@ private static int compareVersionParts(String currentVersionPart, String require } /** - * Return if it's a Paper API based server (Paper or Folia). + * Return if it's a Paper API based server (Paper or Folia, or any Paper fork). * * @return The boolean value of isPaperAPI. */