Skip to content
Draft
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
17 changes: 9 additions & 8 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
java
id("com.gradleup.shadow") version("8.3.5")
id("com.github.ben-manes.versions") version("0.51.0")
id("com.gradleup.shadow") version("8.3.8")
id("com.github.ben-manes.versions") version("0.52.0")
}

// Change to true when releasing
Expand All @@ -14,17 +14,17 @@ 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.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)
Expand Down Expand Up @@ -56,14 +56,15 @@ tasks {
relocate("org.bstats", "com.extendedclip.deluxemenus.libs.bstats")
archiveFileName.set("DeluxeMenus-${rootProject.version}.jar")
}

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
disableAutoTargetJvm()
}

processResources {
filesMatching("plugin.yml") {
filesMatching(listOf("plugin.yml", "paper-plugin.yml")) {
expand("version" to rootProject.version)
}
}
Expand Down
12 changes: 7 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
[versions]
# Compile only
spigot = "1.21.5-R0.1-SNAPSHOT"
#paper = "1.17.1-R0.1-SNAPSHOT"
paper = "1.21.7-R0.1-SNAPSHOT"
vault = "1.7.1"
authlib = "1.5.25"
headdb = "1.3.2"
itemsadder = "3.6.3-beta-14"
nexo = "1.1.0"
itemsadder = "4.0.10"
nexo = "1.8.0"
oraxen = "1.190.0"
mythiclib = "1.7.1-SNAPSHOT"
mmoitems = "6.10-SNAPSHOT"
mmoitems = "6.10.1-SNAPSHOT"
papi = "2.11.6"
score = "4.24.3.5"
sig = "1.5.0"
Expand All @@ -21,11 +23,11 @@ adventure-minimessage = "4.21.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" }
itemsadder = { module = "com.github.LoneDev6:api-itemsadder", version.ref = "itemsadder" }
itemsadder = { module = "dev.lone:api-itemsadder", version.ref = "itemsadder" }
nexo = { module = "com.nexomc:nexo", version.ref = "nexo" }
oraxen = { module = "io.th0rgal:oraxen", version.ref = "oraxen" }
mythiclib = { module = "io.lumine:MythicLib-dist", version.ref = "mythiclib"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class RegistrableMenuCommand extends Command {

public RegistrableMenuCommand(final @NotNull DeluxeMenus plugin,
final @NotNull Menu menu) {
super(menu.options().commands().isEmpty() ? menu.options().name() : menu.options().commands().get(0));
super(menu.options().commands().isEmpty() ? menu.options().name() : menu.options().commands().getFirst());
this.plugin = plugin;
this.menu = menu;

Expand All @@ -42,12 +42,12 @@ public RegistrableMenuCommand(final @NotNull DeluxeMenus plugin,
}

@Override
public boolean execute(final @NotNull CommandSender sender, final @NotNull String commandLabel, final @NotNull String[] typedArgs) {
public boolean execute(final @NotNull CommandSender sender, final @NotNull String commandLabel, final @NotNull String @NotNull [] typedArgs) {
if (this.unregistered) {
throw new IllegalStateException("This command was unregistered!");
}

if (!(sender instanceof Player)) {
if (!(sender instanceof Player player)) {
Msg.msg(sender, "Menus can only be opened by players!");
return true;
}
Expand Down Expand Up @@ -77,7 +77,6 @@ public boolean execute(final @NotNull CommandSender sender, final @NotNull Strin
}
}

Player player = (Player) sender;
plugin.debug(DebugLevel.LOWEST, Level.INFO, "opening menu: " + menu.options().name());
menu.openMenu(player, argMap, null);
return true;
Expand Down Expand Up @@ -138,6 +137,7 @@ public void unregister() {
knownCommands = SimpleCommandMap.class.getDeclaredField("knownCommands");
knownCommands.setAccessible(true);

//noinspection unchecked
final Map<String, Command> knownCommandsMap = (Map<String, Command>) knownCommands.get(cMap.get(Bukkit.getServer()));

// We need to remove every single alias because CommandMap#register() adds them all to the map.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ public <T> Map<String, T> getMetaValues(
return OperationResult.NEW_VALUE_IS_DIFFERENT_TYPE;
}

// TODO: Blitz: It seems that PersistentDataContainer#has(NamespacedKey) does not exist in 1.17.1.
if (player.getPersistentDataContainer().has(key) &&
(!player.getPersistentDataContainer().has(key, type.getPDType()) || !type.isSupported(player.getPersistentDataContainer().get(key, type.getPDType())))) {
return OperationResult.EXISTENT_VALUE_IS_DIFFERENT_TYPE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public static boolean hasPotionMeta(@NotNull final ItemStack itemStack) {
final PotionMeta itemMeta = (PotionMeta) itemStack.getItemMeta();

if (itemMeta != null) {
itemMeta.setBasePotionType(PotionType.WATER);
itemMeta.setBasePotionType(PotionType.WATER); // TODO: Blitz: Check if this works in 1.17.1 (seems that the setBasePotionType method was only added later)
itemStack.setItemMeta(itemMeta);
}

Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/paper-plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name: DeluxeMenus
version: '${version}'
main: com.extendedclip.deluxemenus.DeluxeMenus
description: All in one inventory menu system
api-version: '1.13'
Loading