This commit is contained in:
redtea committed 2024-03-28 10:14:45 +03:00
1 parent 5532f33f82
commit 8e16b05c76
1761 files changed
+317 -3319

No files matched your search

@@ -0,0 +1,10 @@
package tech.carcadex.kotlinbukkitkit.tooling.wizard.bukkit
data class Plugin(
val name: String,
val versions: List<PluginVersion>,
val repositories: Set<String>,
val displayName: String = name
) {
var isSelected = false
}
@@ -0,0 +1,96 @@
package tech.carcadex.kotlinbukkitkit.tooling.wizard.bukkit
import tech.carcadex.kotlinbukkitkit.tooling.wizard.bukkit.ServerVersion.*
private val worldEdit = "com.sk89q.worldedit"
// TODO: plotsquared, multiverse
val ALL_PLUGINS = listOf(
Plugin(
"Vault",
allVersion("1.7") { setOf("com.github.MilkBowl:VaultAPI:$it") },
setOf("https://jitpack.io"),
),
Plugin(
"WorldEdit",
listOf(v1_8, v1_9, v1_12).asPluginVersion("6.1.5") { setOf("$worldEdit:worldedit-core:$it", "$worldEdit:worldedit-bukkit:$it") }
+ listOf(v1_13, v1_14, v1_15, v1_16, v1_17, v1_18, v1_19).asPluginVersion("7.2.14-SNAPSHOT") { setOf("$worldEdit:worldedit-core:$it", "$worldEdit:worldedit-bukkit:$it") }
+ listOf(v1_20).asPluginVersion("7.3.0-SNAPSHOT") { setOf("$worldEdit:worldedit-core:$it", "$worldEdit:worldedit-bukkit:$it") }
,
setOf("http://maven.sk89q.com/repo/")
),
Plugin(
"WorldGuard",
listOf(v1_8, v1_9, v1_12).asPluginVersion("6.1") { setOf("com.sk89q:worldguard:$it") }
+ listOf(v1_13, v1_14, v1_15, v1_16, v1_17, v1_18, v1_19, v1_20).asPluginVersion("7.0.4-SNAPSHOT") { setOf("com.sk89q.worldguard:worldguard-core:$it", "com.sk89q.worldguard:worldguard-bukkit:$it") }
,
setOf("http://maven.sk89q.com/repo/")
),
Plugin(
"Citizens",
allVersion("2.0.27-SNAPSHOT") { setOf("net.citizensnpcs:citizensapi:$it", "net.citizensnpcs:citizens:$it") },
setOf("http://repo.citizensnpcs.co/")
),
Plugin(
"LuckPerms",
allVersion("5.4") { setOf("net.luckperms:api:$it") },
setOf() // mavenCentral
),
Plugin(
"ProtocolLib",
allVersion("5.1.0") { setOf("com.comphenix.protocol:ProtocolLib:$it") },
setOf("http://repo.dmulloy2.net/nexus/repository/public/")
),
Plugin(
"PlaceholderAPI",
allVersion("2.11.5") { setOf("me.clip:placeholderapi:$it") },
setOf("http://repo.extendedclip.com/content/repositories/placeholderapi/")
),
Plugin(
"MVdWPlaceholderAPI",
allVersion("3.1.1") { setOf("be.maximvdw:MVdWPlaceholderAPI:$it") },
setOf("http://repo.mvdw-software.be/content/groups/public/")),
Plugin(
"ActionBarAPI",
allVersion("d60c2aedb9") { setOf("com.github.ConnorLinfoot:ActionBarAPI:$it") },
setOf("https://jitpack.io")
),
Plugin(
"TitleAPI",
allVersion("1.8.1") { setOf("com.github.ConnorLinfoot:TitleAPI:$it") },
setOf("https://jitpack.io")),
Plugin(
"ViaVersion",
allVersion("4.9.3") { setOf("us.myles:viaversion-common:$it") },
setOf("https://repo.viaversion.com/")
),
Plugin(
"BossBarAPI",
allVersion("2.4.2") { setOf("org.inventivetalent:bossbarapi:$it") },
setOf("https://repo.inventivetalent.org/content/groups/public/")
),
Plugin(
"HologramAPI",
allVersion("1.6.0") { setOf("org.inventivetalent:hologramapi:$it") },
setOf("https://repo.inventivetalent.org/content/groups/public/")
),
Plugin(
"NoDropX",
allVersion("1.0.3c") { setOf("com.github.iRedTea:NoDropX:$it") },
setOf("https://jitpack.io")
),
Plugin(
"EssentialsX",
allVersion("2.20.1") { setOf("net.essentialsx:EssentialsX:$it") },
setOf("https://repo.essentialsx.net/releases/")
),
Plugin(
"Multiverse-Core",
allVersion("4.3.1") { setOf("com.onarandombox.multiversecore:Multiverse-Core:$it") },
setOf("https://repo.onarandombox.com/content/groups/public/")
),
)
inline fun allVersion(version: String, dependencies: (String) -> Set<String>): List<PluginVersion> = ServerVersion.values().map { PluginVersion(version, it, dependencies(version)) }
inline fun List<ServerVersion>.asPluginVersion(version: String, dependencies: (String) -> Set<String>): List<PluginVersion> = map { PluginVersion(version, it, dependencies(version)) }
@@ -0,0 +1,7 @@
package tech.carcadex.kotlinbukkitkit.tooling.wizard.bukkit
class PluginVersion(
val version: String,
val serverVersion: ServerVersion,
val dependencies: Set<String>
)
@@ -0,0 +1,54 @@
package tech.carcadex.kotlinbukkitkit.tooling.wizard.bukkit
data class ServerAPI(
val version: ServerVersion,
val serverType: ServerType
)
val ServerAPI.dependencies: List<String> get() {
val versionName = when(version) {
ServerVersion.v1_8 -> "1.8.8-R0.1-SNAPSHOT"
ServerVersion.v1_9 -> "1.9.4-R0.1-SNAPSHOT"
ServerVersion.v1_12 -> "1.12.2-R0.1-SNAPSHOT"
ServerVersion.v1_13 -> "1.13.2-R0.1-SNAPSHOT"
ServerVersion.v1_14 -> "1.14.4-R0.1-SNAPSHOT"
ServerVersion.v1_15 -> "1.15.2-R0.1-SNAPSHOT"
ServerVersion.v1_16 -> "1.16.5-R0.1-SNAPSHOT"
ServerVersion.v1_17 -> "1.17.1-R0.1-SNAPSHOT"
ServerVersion.v1_18 -> "1.18.2-R0.1-SNAPSHOT"
ServerVersion.v1_19 -> "1.19.4-R0.1-SNAPSHOT"
ServerVersion.v1_20 -> "1.20.4-R0.1-SNAPSHOT"
}
val dependency = when(serverType) {
ServerType.SPIGOT -> "org.spigotmc:spigot-api:$versionName"
ServerType.PAPERMC -> {
val v17 = "org.github.paperspigot:paperspigot-api"
val v19 = "com.destroystokyo.paper:paper-api"
val v20 = "io.papermc.paper:paper-api"
when(version) {
ServerVersion.v1_8 -> "$v17:$versionName"
ServerVersion.v1_9, ServerVersion.v1_12, ServerVersion.v1_13,
ServerVersion.v1_14, ServerVersion.v1_15, ServerVersion.v1_16 -> "$v19:$versionName";
else -> "$v20:$versionName"
}
}
}
return listOf(dependency)
}
val ServerAPI.repositories: List<String> get() {
return when(serverType) {
ServerType.SPIGOT -> listOf(
"https://hub.spigotmc.org/nexus/content/repositories/snapshots/",
"https://oss.sonatype.org/content/repositories/snapshots/"
)
ServerType.PAPERMC -> listOf(
"https://papermc.io/repo/repository/maven-public/",
"https://oss.sonatype.org/content/repositories/snapshots/"
)
}
}
@@ -0,0 +1,5 @@
package tech.carcadex.kotlinbukkitkit.tooling.wizard.bukkit
enum class ServerType {
SPIGOT, PAPERMC
}
@@ -0,0 +1,20 @@
package tech.carcadex.kotlinbukkitkit.tooling.wizard.bukkit
enum class ServerVersion(val displayName: String, val maxVersion: String, val minor: Int,) {
v1_8("1.8", "1.8.9", 8),
v1_9("1.9", "1.9.4", 9),
v1_12("1.12", "1.12.2", 12),
v1_13("1.13", "1.13.2", 13),
v1_14("1.14", "1.14.4", 14),
v1_15("1.15", "1.15.2", 15),
v1_16("1.16", "1.16.5", 16),
v1_17("1.17", "1.17.1", 17),
v1_18("1.18", "1.18.2", 18),
v1_19("1.19", "1.19.4", 19),
v1_20("1.20", "1.20.4", 20),;
override fun toString(): String {
return displayName
}
}