Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
21 changes: 14 additions & 7 deletions readme.md
Original file line number Diff line number Diff line change
@@ -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)

Expand All @@ -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.
Expand Down Expand Up @@ -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) | — |
Expand All @@ -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) |

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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?");
Expand Down Expand Up @@ -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.
*/
Expand Down