diff --git a/plugin/build.gradle b/plugin/build.gradle index ad2d8bd..46c04df 100644 --- a/plugin/build.gradle +++ b/plugin/build.gradle @@ -44,24 +44,24 @@ dependencies { compileOnly('com.github.MilkBowl:VaultAPI:1.7') { transitive false } // NBT - compileOnly 'de.tr7zw:item-nbt-api-plugin:2.12.1' + compileOnly 'de.tr7zw:item-nbt-api-plugin:2.13.1' // Adventure - def adventureVersion = '4.14.0' - def adventurePlatformVersion = '4.3.1' + def adventureVersion = '4.17.0' + def adventurePlatformVersion = '4.3.3' implementation "net.kyori:adventure-api:$adventureVersion" implementation "net.kyori:adventure-platform-bukkit:$adventurePlatformVersion" implementation "net.kyori:adventure-text-minimessage:$adventureVersion" // GUis and commands - implementation 'dev.triumphteam:triumph-gui:3.1.7' + implementation 'dev.triumphteam:triumph-gui:3.1.10' implementation 'me.mattstudios.utils:matt-framework:1.4.6' // Heads compileOnly('com.arcaniax:HeadDatabase-API:1.3.1') { transitive false } // WorldGuard compatibility - ['base', 'v6', 'v7'].forEach {implementation project(':plugin:compatibility:worldguard:' + it) } + ['base', 'v6', 'v7'].forEach { implementation project(':plugin:compatibility:worldguard:' + it) } // bStats implementation 'org.bstats:bstats-bukkit:3.0.0' @@ -92,7 +92,7 @@ shadowJar { [ 'me.gabytm.util.actions': 'actions', 'dev.triumphteam.gui' : 'gui', - 'net.kyori.adventure' : 'adventure', + 'net.kyori' : 'kyori', 'me.mattstudios.mf' : 'commands', 'sh.okx.timeapi' : 'timeapi', 'org.bstats' : 'bstats', diff --git a/plugin/src/main/kotlin/me/gabytm/minecraft/arcanevouchers/ServerVersion.kt b/plugin/src/main/kotlin/me/gabytm/minecraft/arcanevouchers/ServerVersion.kt index 3322fe0..4fa86ab 100644 --- a/plugin/src/main/kotlin/me/gabytm/minecraft/arcanevouchers/ServerVersion.kt +++ b/plugin/src/main/kotlin/me/gabytm/minecraft/arcanevouchers/ServerVersion.kt @@ -1,5 +1,6 @@ package me.gabytm.minecraft.arcanevouchers +import me.gabytm.minecraft.arcanevouchers.functions.info import org.bukkit.Bukkit import org.bukkit.Server import java.util.regex.Pattern @@ -72,8 +73,9 @@ object ServerVersion { } private fun getCurrentVersionAsString(): String { - val matcher = Pattern.compile("\\d+\\.\\d+(?:\\.\\d+)?").matcher(getMinecraftVersion()) - return if (matcher.find()) matcher.group() else "unknown" + val minecraftVersion = getMinecraftVersion() + val matcher = Pattern.compile("\\d+\\.\\d+(?:\\.\\d+)?").matcher(minecraftVersion) + return if (matcher.find()) matcher.group() else minecraftVersion } private fun getMinecraftVersion(): String { @@ -81,8 +83,9 @@ object ServerVersion { // Paper method val method = Server::class.java.getDeclaredMethod("getMinecraftVersion") return method.invoke(Bukkit.getServer()) as String - } catch (ignored: NoSuchMethodError) { - return Bukkit.getServer().javaClass.`package`.name.substringAfterLast('.'); + } catch (ignored: NoSuchMethodException) { + // Version is formatted as 'minor.major.patch-R0.1-SNAPSHOT' + return Bukkit.getServer().bukkitVersion.split('-')[0] } } diff --git a/plugin/src/main/kotlin/me/gabytm/minecraft/arcanevouchers/items/ItemCreator.kt b/plugin/src/main/kotlin/me/gabytm/minecraft/arcanevouchers/items/ItemCreator.kt index 942a76d..1f5125e 100644 --- a/plugin/src/main/kotlin/me/gabytm/minecraft/arcanevouchers/items/ItemCreator.kt +++ b/plugin/src/main/kotlin/me/gabytm/minecraft/arcanevouchers/items/ItemCreator.kt @@ -71,7 +71,6 @@ class ItemCreator(plugin: ArcaneVouchers) { val item = this .name(config.getString("name")?.mini(true) ?: Component.empty()) .lore(config.getStringList("lore").map { it.mini(true) }) - .flags(*flags) .enchant(enchants, true) .unbreakable(config.getBoolean("unbreakable")) .apply { @@ -84,7 +83,9 @@ class ItemCreator(plugin: ArcaneVouchers) { } config.getString("color")?.toColor()?.let { color(it) } - }.build() + } + .flags(*flags) + .build() if (isVoucher) { // Get the JSON of this voucher