Skip to content

Commit

Permalink
feat(version-support): add base 1.16.4 to 1.13 support
Browse files Browse the repository at this point in the history
  • Loading branch information
StillLutto committed Dec 24, 2024
1 parent 73dc576 commit 7e741eb
Show file tree
Hide file tree
Showing 94 changed files with 10,597 additions and 17 deletions.
16 changes: 15 additions & 1 deletion api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,23 @@ version = versionVar
dependencies {
compileOnly("org.spigotmc:spigot-api:1.20.6-R0.1-SNAPSHOT")
implementation(project(":common"))
implementation(project(":v1_13"))
implementation(project(":v1_13_1"))
implementation(project(":v1_13_2"))
implementation(project(":v1_14_1"))
implementation(project(":v1_14_2"))
implementation(project(":v1_14_3"))
implementation(project(":v1_14_4"))
implementation(project(":v1_15"))
implementation(project(":v1_15_1"))
implementation(project(":v1_15_2"))
implementation(project(":v1_16_1"))
implementation(project(":v1_16_2"))
implementation(project(":v1_16_3"))
implementation(project(":v1_16_4"))
implementation(project(":v1_16_5"))
implementation(project(":v1_17"))
implementation(project(":v1_17_1"))
implementation(project(":v1_17_1", "reobf"))
implementation(project(":v1_18_1"))
implementation(project(":v1_18_2"))
implementation(project(":v1_19_2"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,22 @@ import kotlin.reflect.KClass
@ApiStatus.Internal
object CommandManager {
val registrars: Map<String, KClass<out AbstractCommandRegistrar>> = mapOf(
"1.13" to com.undefined.stellar.v1_13.CommandRegistrar::class,
"1.13.1" to com.undefined.stellar.v1_13_1.CommandRegistrar::class,
"1.13.2" to com.undefined.stellar.v1_13_2.CommandRegistrar::class,
"1.14" to com.undefined.stellar.v1_14_1.CommandRegistrar::class,
"1.14.1" to com.undefined.stellar.v1_14_1.CommandRegistrar::class,
"1.14.2" to com.undefined.stellar.v1_14_2.CommandRegistrar::class,
"1.14.3" to com.undefined.stellar.v1_14_3.CommandRegistrar::class,
"1.14.4" to com.undefined.stellar.v1_14_4.CommandRegistrar::class,
"1.15" to com.undefined.stellar.v1_15.CommandRegistrar::class,
"1.15.1" to com.undefined.stellar.v1_15_1.CommandRegistrar::class,
"1.15.2" to com.undefined.stellar.v1_15_2.CommandRegistrar::class,
"1.16" to com.undefined.stellar.v1_16_1.CommandRegistrar::class,
"1.16.1" to com.undefined.stellar.v1_16_1.CommandRegistrar::class,
"1.16.2" to com.undefined.stellar.v1_16_2.CommandRegistrar::class,
"1.16.3" to com.undefined.stellar.v1_16_3.CommandRegistrar::class,
"1.16.4" to com.undefined.stellar.v1_16_4.CommandRegistrar::class,
"1.16.5" to com.undefined.stellar.v1_16_5.CommandRegistrar::class,
"1.17" to com.undefined.stellar.v1_17.CommandRegistrar::class,
"1.17.1" to com.undefined.stellar.v1_17_1.CommandRegistrar::class,
Expand Down
15 changes: 15 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,23 @@ allprojects {
dependencies {
implementation(project(":api"))
implementation(project(":common"))
implementation(project(":v1_13"))
implementation(project(":v1_13_1"))
implementation(project(":v1_13_2"))
implementation(project(":v1_14_1"))
implementation(project(":v1_14_2"))
implementation(project(":v1_14_3"))
implementation(project(":v1_14_4"))
implementation(project(":v1_15"))
implementation(project(":v1_15_1"))
implementation(project(":v1_15_2"))
implementation(project(":v1_16_1"))
implementation(project(":v1_16_2"))
implementation(project(":v1_16_3"))
implementation(project(":v1_16_4"))
implementation(project(":v1_16_5"))
implementation(project(":v1_17"))
implementation(project(":v1_17"))
implementation(project(":v1_17_1:", "reobf"))
implementation(project(":v1_18_1:", "reobf"))
implementation(project(":v1_18_2:", "reobf"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ object ReflectionUtil {
fun <T : Any> getPrivateField(any: Class<*>, name: String): T =
any::class.java.getDeclaredField(name).apply { isAccessible = true }[this] as T

inline fun <reified T : Any, R> getPrivateMethod(name: String, vararg args: Any?): R =
inline fun <reified T : Any, R> executePrivateMethod(name: String, vararg args: Any?): R =
T::class.java.getDeclaredMethod(name).apply { isAccessible = true }(null, args) as R
}

Expand Down
28 changes: 23 additions & 5 deletions server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,24 @@ val groupIdVar = "com.undefined"
val artifactIdVar = "stellar"

dependencies {
compileOnly("org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT")
compileOnly("org.spigotmc:spigot-api:1.13-R0.1-SNAPSHOT")

implementation(project(":api"))
implementation(project(":common"))
implementation(project(":v1_13"))
implementation(project(":v1_13_1"))
implementation(project(":v1_13_2"))
implementation(project(":v1_14_1"))
implementation(project(":v1_14_2"))
implementation(project(":v1_14_3"))
implementation(project(":v1_14_4"))
implementation(project(":v1_15"))
implementation(project(":v1_15_1"))
implementation(project(":v1_15_2"))
implementation(project(":v1_16_1"))
implementation(project(":v1_16_2"))
implementation(project(":v1_16_3"))
implementation(project(":v1_16_4"))
implementation(project(":v1_16_5"))
implementation(project(":v1_17"))
implementation(project(":v1_17_1:", "reobf"))
Expand All @@ -30,7 +44,7 @@ dependencies {
implementation(project(":v1_21_1:", "reobf"))
implementation(project(":v1_21_3:", "reobf"))
implementation(project(":v1_21_4:", "reobf"))
compileOnly(project(":v1_16_5"))
compileOnly(project(":v1_13"))
}

tasks {
Expand All @@ -43,11 +57,15 @@ tasks {
}

compileKotlin {
kotlinOptions.jvmTarget = "16"
kotlinOptions.jvmTarget = "1.8"
}

compileJava {
options.release = 8
}

runServer {
minecraftVersion("1.16.5")
minecraftVersion("1.13")
jvmArgs("-Xmx2G")
}
}
Expand All @@ -57,5 +75,5 @@ java {
}

kotlin {
jvmToolchain(16)
jvmToolchain(8)
}
9 changes: 5 additions & 4 deletions server/src/main/kotlin/com/undefined/stellar/Main.kt
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
package com.undefined.stellar

import com.undefined.stellar.data.argument.ParticleData
import org.bukkit.entity.Player
import org.bukkit.plugin.java.JavaPlugin

class Main : JavaPlugin() {

override fun onEnable() {
StellarCommand("set-time")
.addTimeArgument("time")
StellarCommand("spawn-particle")
.addParticleArgument("particle")
.addExecution<Player> {
val time = getArgument<Long>("time")
sender.world.time = time
val data = getArgument<ParticleData<*>>("particle")
sender.spawnParticle(data.particle, sender.eyeLocation, 10, 1.0, 1.0, 1.0, data.options)
}
.register(this)
}
Expand Down
2 changes: 1 addition & 1 deletion server/src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Stellar
version: '${version}'
main: com.undefined.stellar.Main
api-version: '1.16'
api-version: '1.13'
37 changes: 36 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,2 +1,37 @@
rootProject.name = "stellar"
include("server", "api", "common", "v1_16_5", "v1_17", "v1_17_1", "v1_18_1", "v1_18_2", "v1_19_2", "v1_19_3", "v1_19_4", "v1_20", "v1_20_1", "v1_20_2", "v1_20_4", "v1_20_6", "v1_21", "v1_21_1", "v1_21_3", "v1_21_4")
include(
"server",
"api",
"common",
"v1_13",
"v1_13_1",
"v1_13_2",
"v1_14_1",
"v1_14_2",
"v1_14_3",
"v1_14_4",
"v1_15",
"v1_15_1",
"v1_15_2",
"v1_16_1",
"v1_16_2",
"v1_16_3",
"v1_16_4",
"v1_16_5",
"v1_17",
"v1_17_1",
"v1_18_1",
"v1_18_2",
"v1_19_2",
"v1_19_3",
"v1_19_4",
"v1_20",
"v1_20_1",
"v1_20_2",
"v1_20_4",
"v1_20_6",
"v1_21",
"v1_21_1",
"v1_21_3",
"v1_21_4"
)
29 changes: 29 additions & 0 deletions v1_13/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
plugins {
kotlin("jvm") version "1.9.22"
}

repositories {
mavenLocal()
}

dependencies {
compileOnly("org.spigotmc:spigot:1.13-R0.1-SNAPSHOT")
compileOnly(project(":common"))
}

tasks {
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileJava {
options.release.set(8)
}
}

java {
disableAutoTargetJvm()
}

kotlin {
jvmToolchain(21)
}
Loading

0 comments on commit 7e741eb

Please sign in to comment.