Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
0eac799
Moved to Paper-API, Upgraded to Java 17, Upgraded libraries
BlitzOffline Jul 17, 2025
ce1a559
Upgrade to Java 21, Make use of some Java 21 syntax sugar, Add some n…
BlitzOffline Jul 17, 2025
ce612da
Removed unused maven repositories, and added Paper official maven rep…
BlitzOffline Jul 17, 2025
d3ef1bb
Merge branch 'main' into paper-only
BlitzOffline Jul 17, 2025
02225e0
Merge remote-tracking branch 'origin/main' into paper-only
BlitzOffline Aug 12, 2026
d9e0108
Update to latest paper api version
BlitzOffline Aug 12, 2026
4b663c1
Migrating to paper - phase 0 - setup
BlitzOffline Aug 12, 2026
abfb6fa
Migrating to paper - phase 1 - replace adventure-bukkit with paper me…
BlitzOffline Aug 12, 2026
e050e26
Migrating to paper - phase 3 - Set version floor to 1.20.6
BlitzOffline Aug 12, 2026
bcd65c1
Migrating to paper - phase 4 - remove NMS and other unsupported features
BlitzOffline Aug 12, 2026
c970fbf
Migrating to paper - phase 5 - replace bungee usage with adventure
BlitzOffline Aug 13, 2026
04a9347
Make [PLAYER] action execute perormCommand (to separate from [command…
BlitzOffline Aug 13, 2026
ecfe77d
Migrating to paper - phase 6 - Use brigadier for DM commands, and swa…
BlitzOffline Aug 13, 2026
251f098
Fix registry lookup on older versions
BlitzOffline Aug 17, 2026
4210011
Fix component build on 1.20.6
BlitzOffline Aug 17, 2026
21d5018
Fix italic always set to false
BlitzOffline Aug 17, 2026
0039131
Add new config option to suppress default italics
BlitzOffline Aug 17, 2026
6be2990
Remove remaining TODOs
BlitzOffline Aug 17, 2026
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 .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
- name: Set up JDK 25
uses: actions/setup-java@v4
with:
java-version: '21'
java-version: '25'
distribution: 'temurin'

# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
Expand Down Expand Up @@ -59,10 +59,10 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
- name: Set up JDK 25
uses: actions/setup-java@v4
with:
java-version: '21'
java-version: '25'
distribution: 'temurin'

# Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies.
Expand Down
28 changes: 15 additions & 13 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,20 @@ version = "$majorVersion-$minorVersion"

repositories {
mavenCentral()
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/")
maven("https://repo.glaremasters.me/repository/public/")
maven("https://nexus.phoenixdevt.fr/repository/maven-public/")
maven("https://repo.momirealms.net/releases/")
maven("https://repo.nexomc.com/releases/")
maven("https://repo.oraxen.com/releases")
maven("https://maven.devs.beer/")
maven("https://jitpack.io")
}

dependencies {
compileOnly(libs.spigot)
compileOnly(libs.paper)

compileOnly(libs.vault)
compileOnly(libs.authlib)

compileOnly(libs.headdb)
compileOnly(libs.headdb.api)
Expand All @@ -45,29 +44,32 @@ dependencies {
compileOnly(libs.papi)

implementation(libs.nashorn)
implementation(libs.adventure.platform)
implementation(libs.adventure.minimessage)
implementation(libs.bstats)

compileOnly("org.jetbrains:annotations:26.1.0")
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(25))
}
disableAutoTargetJvm()
}

tasks {
withType<JavaCompile> {
options.release.set(21)
}

shadowJar {
relocate("org.objectweb.asm", "com.extendedclip.deluxemenus.libs.asm")
relocate("org.openjdk.nashorn", "com.extendedclip.deluxemenus.libs.nashorn")
relocate("net.kyori", "com.extendedclip.deluxemenus.libs.adventure")
relocate("org.bstats", "com.extendedclip.deluxemenus.libs.bstats")
archiveFileName.set("DeluxeMenus-${rootProject.version}.jar")
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
disableAutoTargetJvm()
}

processResources {
filesMatching("plugin.yml") {
filesMatching("paper-plugin.yml") {
expand("version" to rootProject.version)
}
}
Expand Down
10 changes: 2 additions & 8 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[versions]
# Compile only
spigot = "26.2-R0.1-SNAPSHOT"
paper = "26.2.build.112-stable"
vault = "1.7.1"
authlib = "1.5.25"
headdb = "1.3.2"
headdb-api = "v7.0.0-rc.3"
craftengine = "26.7"
Expand All @@ -18,14 +17,11 @@ bstats = "3.2.1"

# Implementation
nashorn = "15.7"
adventure-platform = "4.4.1"
adventure-minimessage = "5.2.0"

[libraries]
# Compile only
spigot = { module = "org.spigotmc:spigot-api", version.ref = "spigot" }
paper = { module = "io.papermc.paper:paper-api", version.ref = "paper" }
vault = { module = "com.github.milkbowl:VaultAPI", version.ref = "vault" }
authlib = { module = "com.mojang:authlib", version.ref = "authlib" }
headdb = { module = "com.arcaniax:HeadDatabase-API", version.ref = "headdb" }
headdb-api = { module = "com.github.SilentDevelopment.HeadDB:headdb-api", version.ref = "headdb-api" }
craftengine-core = { module = "net.momirealms:craft-engine-core", version.ref = "craftengine"}
Expand All @@ -41,6 +37,4 @@ sig = { module = "io.github.valerashimchuck:simpleitemgenerator-api", version.re

# Implementation
nashorn = { module = "org.openjdk.nashorn:nashorn-core", version.ref = "nashorn" }
adventure-platform = { module = "net.kyori:adventure-platform-bukkit", version.ref = "adventure-platform" }
adventure-minimessage = { module = "net.kyori:adventure-text-minimessage", version.ref = "adventure-minimessage" }
bstats = { module = "org.bstats:bstats-bukkit", version.ref = "bstats" }
84 changes: 19 additions & 65 deletions src/main/java/com/extendedclip/deluxemenus/DeluxeMenus.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,16 @@
import com.extendedclip.deluxemenus.hooks.*;
import com.extendedclip.deluxemenus.listener.PlayerListener;
import com.extendedclip.deluxemenus.menu.Menu;
import com.extendedclip.deluxemenus.menu.MenuItem;
import com.extendedclip.deluxemenus.menu.options.HeadType;
import com.extendedclip.deluxemenus.menu.options.MenuOptions;
import com.extendedclip.deluxemenus.nbt.NbtProvider;
import com.extendedclip.deluxemenus.persistentmeta.PersistentMetaHandler;
import com.extendedclip.deluxemenus.placeholder.Expansion;
import com.extendedclip.deluxemenus.updatechecker.UpdateChecker;
import com.extendedclip.deluxemenus.utils.DebugLevel;
import com.extendedclip.deluxemenus.utils.Messages;
import com.extendedclip.deluxemenus.utils.VersionHelper;
import com.google.common.io.ByteArrayDataOutput;
import com.google.common.io.ByteStreams;
import net.kyori.adventure.platform.bukkit.BukkitAudiences;
import io.papermc.paper.plugin.lifecycle.event.types.LifecycleEvents;
import net.kyori.adventure.text.Component;
import org.bstats.bukkit.Metrics;
import org.bstats.charts.AdvancedPie;
Expand Down Expand Up @@ -51,8 +48,6 @@ public class DeluxeMenus extends JavaPlugin {
private MenuItemMarker menuItemMarker;
private EphemeralCooldownManager ephemeralCooldownManager;

private BukkitAudiences audiences;

private VaultHook vaultHook;

private ItemStack head;
Expand All @@ -61,20 +56,6 @@ public class DeluxeMenus extends JavaPlugin {
private final GeneralConfig generalConfig = new GeneralConfig(this);
private DeluxeMenusConfig menuConfig;

@Override
public void onLoad() {
if (NbtProvider.isAvailable()) {
this.debug(DebugLevel.HIGHEST, Level.INFO, "NMS hook has been setup successfully!");
return;
}

this.debug(
DebugLevel.HIGHEST,
Level.WARNING,
"Could not setup a NMS hook for your server version! The following Item options will not work: nbt_int, nbt_ints, nbt_string and nbt_strings."
);
}

@Override
public void onEnable() {
this.generalConfig.load();
Expand All @@ -91,8 +72,6 @@ public void onEnable() {
this.ephemeralCooldownManager = new EphemeralCooldownManager(this);
this.ephemeralCooldownManager.startSweepTask();

this.audiences = BukkitAudiences.create(this);

hookIntoVault();
setUpItemHooks();

Expand All @@ -104,9 +83,7 @@ public void onEnable() {
}

new PlayerListener(this).register();
if (!new DeluxeMenusCommand(this).register()) {
debug(DebugLevel.HIGHEST, Level.SEVERE, "Could not register the DeluxeMenus command!");
}
registerMainCommand();
new Expansion(this).register();

setUpBungeeCordMessaging();
Expand All @@ -120,11 +97,6 @@ public void onDisable() {

Bukkit.getScheduler().cancelTasks(this);

if (this.audiences != null) {
this.audiences.close();
this.audiences = null;
}

Menu.unloadForShutdown(this);

if (this.ephemeralCooldownManager != null) {
Expand Down Expand Up @@ -174,11 +146,11 @@ public void connect(Player p, String server) {
}

public void sms(CommandSender s, Component msg) {
audiences().sender(s).sendMessage(msg);
s.sendMessage(msg);
}

public void sms(CommandSender s, Messages msg) {
audiences().sender(s).sendMessage(msg.message());
s.sendMessage(msg.message());
}

public void debug(@NotNull final DebugLevel messageDebugLevel, @NotNull final Level level, @NotNull final String... messages) {
Expand Down Expand Up @@ -211,13 +183,6 @@ public EphemeralCooldownManager getEphemeralCooldownManager() {
return ephemeralCooldownManager;
}

public BukkitAudiences audiences() {
if (this.audiences == null) {
throw new IllegalStateException("Tried to access Adventure when the plugin was disabled!");
}
return this.audiences;
}

public void clearCaches() {
itemHooks.values().stream().filter(Objects::nonNull).filter(hook -> hook instanceof SimpleCache).map(hook -> (SimpleCache) hook).forEach(SimpleCache::clearCache);
}
Expand Down Expand Up @@ -256,13 +221,8 @@ private void hookIntoVault() {
"DeluxeMenus will continue to work but some features (such as the 'has money' requirement) may not be available.");
}

@SuppressWarnings("deprecation")
private void setUpItemHooks() {
if (!VersionHelper.IS_ITEM_LEGACY) {
this.head = new ItemStack(Material.PLAYER_HEAD, 1);
} else {
this.head = new ItemStack(Material.valueOf("SKULL_ITEM"), 1, (short) 3);
}
this.head = new ItemStack(Material.PLAYER_HEAD, 1);

this.itemHooks = new HashMap<>();

Expand Down Expand Up @@ -325,6 +285,20 @@ private void setUpItemHooks() {
}
}

private void registerMainCommand() {
final DeluxeMenusCommand command = new DeluxeMenusCommand(this);

// paper-plugin.yml has no `commands:` block, so the command is registered through the
// lifecycle registrar.
this.getLifecycleManager().registerEventHandler(LifecycleEvents.COMMANDS, event ->
event.registrar().register(
"deluxemenus",
"DeluxeMenus main commands",
List.of("dm", "deluxemenu", "dmenu"),
command
));
}

private void setUpBungeeCordMessaging() {
Bukkit.getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
}
Expand Down Expand Up @@ -353,25 +327,5 @@ private void setUpMetrics() {
.map(Menu::options)
.map(MenuOptions::type)
.collect(Collectors.groupingBy(Enum::name, Collectors.summingInt(type -> 1)))));

// added for 1.21 usage
metrics.addCustomChart(new AdvancedPie("nbt_usage", () -> {
final var results = new HashMap<String, Integer>();
final var options = Menu.getAllMenus().stream()
.map(Menu::getMenuItems)
.flatMap(c -> c.values().stream().map(TreeMap::values).flatMap(Collection::stream))
.map(MenuItem::options)
.collect(Collectors.toList());
results.put("Byte", options.stream().filter(option -> option.nbtByte().isPresent()).mapToInt(b -> 1).sum());
results.put("Bytes", options.stream().filter(option -> !option.nbtBytes().isEmpty()).mapToInt(b -> 1).sum());
results.put("Short", options.stream().filter(option -> option.nbtShort().isPresent()).mapToInt(s -> 1).sum());
results.put("Shorts", options.stream().filter(option -> !option.nbtShorts().isEmpty()).mapToInt(s -> 1).sum());
results.put("Int", options.stream().filter(option -> option.nbtInt().isPresent()).mapToInt(i -> 1).sum());
results.put("Ints", options.stream().filter(option -> !option.nbtInts().isEmpty()).mapToInt(i -> 1).sum());
results.put("String", options.stream().filter(option -> option.nbtString().isPresent()).mapToInt(s -> 1).sum());
results.put("Strings", options.stream().filter(option -> !option.nbtStrings().isEmpty()).mapToInt(s -> 1).sum());
results.put("Model Data", options.stream().filter(option -> option.customModelData().isPresent()).mapToInt(c -> 1).sum());
return results;
}));
}
}
Loading
Loading