Updated to Kotlin 2.1.0

This commit is contained in:
Will FP
2024-12-05 16:22:00 +00:00
parent fa6753c7c1
commit 1e2d87c9fa
11 changed files with 16 additions and 13 deletions

View File

@@ -1,10 +1,12 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.21")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:2.1.0")
}
}
@@ -13,7 +15,7 @@ plugins {
id("com.gradleup.shadow") version "8.3.5"
id("maven-publish")
id("java")
kotlin("jvm") version "1.9.21"
kotlin("jvm") version "2.1.0"
}
dependencies {
@@ -108,12 +110,12 @@ allprojects {
dependencies {
// Kotlin
implementation(kotlin("stdlib", version = "1.9.21"))
implementation(kotlin("stdlib", version = "2.1.0"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
// Included in spigot jar, no need to move to implementation
compileOnly("org.jetbrains:annotations:23.0.0")
compileOnly("com.google.guava:guava:31.1-jre")
compileOnly("com.google.guava:guava:32.0.0-jre")
// Test
testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.2")
@@ -157,8 +159,8 @@ allprojects {
}
compileKotlin {
kotlinOptions {
jvmTarget = "17"
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
}
}

View File

@@ -80,9 +80,11 @@ class EcoEventManager(private val plugin: EcoPlugin) : EventManager {
}
override fun registerPacketListener(listener: PacketListener) {
listeners[listener.priority] += RegisteredPacketListener(
plugin,
listener
listeners[listener.priority].add(
RegisteredPacketListener(
plugin,
listener
)
)
}
}

View File

@@ -23,7 +23,7 @@ class EcoSlotBuilder(private val provider: SlotProvider) : SlotBuilder {
private var notCaptiveFor: (Player) -> Boolean = { _ -> false}
override fun onClick(type: ClickType, action: SlotHandler): SlotBuilder {
handlers[type] += action
handlers[type].add(action)
return this
}

View File

@@ -10,7 +10,7 @@ import net.minecraft.world.entity.monster.RangedAttackMob
object RangedBowAttackGoalFactory : EntityGoalFactory<EntityGoalRangedBowAttack> {
override fun create(apiGoal: EntityGoalRangedBowAttack, entity: PathfinderMob): Goal? {
(if (entity !is Monster) return null)
if (entity !is Monster) return null
if (entity !is RangedAttackMob) return null
return RangedBowAttackGoal(

View File

@@ -11,7 +11,7 @@ import net.minecraft.world.entity.monster.RangedAttackMob
object RangedCrossbowAttackGoalFactory : EntityGoalFactory<EntityGoalRangedCrossbowAttack> {
override fun create(apiGoal: EntityGoalRangedCrossbowAttack, entity: PathfinderMob): Goal? {
(if (entity !is Monster) return null)
if (entity !is Monster) return null
if (entity !is RangedAttackMob) return null
if (entity !is CrossbowAttackMob) return null

View File

@@ -1,2 +1 @@
version = 6.74.4
kotlin.incremental.useClasspathSnapshot=false

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
lib/oraxen-1.185.0.jar Normal file

Binary file not shown.