mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 08:14:00 +02:00
small utility I forgot
This commit is contained in:
parent
a8ac725ce1
commit
bd17d55346
2 changed files with 10 additions and 1 deletions
|
|
@ -2,6 +2,7 @@ package xyz.alexcrea.cuanvil.dependency.datapack
|
|||
|
||||
import io.papermc.paper.datapack.Datapack
|
||||
import org.bukkit.Bukkit
|
||||
import org.bukkit.packs.DataPack
|
||||
import java.util.*
|
||||
|
||||
object DataPackTester {
|
||||
|
|
@ -21,6 +22,13 @@ object DataPackTester {
|
|||
.stream().map { obj: Datapack -> obj.name }
|
||||
.toList()
|
||||
} catch (e: NoSuchMethodException) {
|
||||
try {
|
||||
DataPack::class.java.getDeclaredMethod("getKey")
|
||||
} catch (e: NoSuchMethodException) {
|
||||
System.err.println("Could not find compatible datapack manager")
|
||||
System.err.println("If you are using a datapack that should be compatible with CustomAnvil. It will not get detected...")
|
||||
return emptyList()
|
||||
}
|
||||
return legacyNames
|
||||
} catch (e: Exception){
|
||||
// Assume cause UnimplementedOperationException on mock server
|
||||
|
|
|
|||
|
|
@ -23,7 +23,8 @@ object DataPackDependency {
|
|||
* Map of the latest CustomAnvil update related to the pack
|
||||
*/
|
||||
private val LASTEST_VERSION = mapOf(
|
||||
Pair("bracken", Version(1, 11, 0))
|
||||
Pair("bracken", Version(1, 11, 0)),
|
||||
Pair("neoenchant", Version(1, 13, 0))
|
||||
)
|
||||
|
||||
val enabledDatapacks: List<String>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue