Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
Bump Minestom/KStom
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoDog896 committed Jan 8, 2022
1 parent d82f2e7 commit af0da5f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
12 changes: 6 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ dependencies {
compileOnly(kotlin("reflect"))

// Compile Minestom into project
compileOnly("com.github.Minestom", "Minestom", "2ef8e957a0")
compileOnly("com.github.Minestom", "Minestom", "4ee5cbe424")

// KStom
compileOnly("com.github.Project-Cepi", "KStom","4a9407ba0a")
compileOnly("com.github.Project-Cepi", "KStom","05b5e1f2a1")

// import kotlinx serialization
compileOnly("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.1")
Expand All @@ -57,7 +57,7 @@ tasks {
}

processResources {
filesMatching("extension.json") {
filesMatching("META-INF/extension.json") {
expand(project.properties)
}
}
Expand All @@ -71,9 +71,9 @@ tasks {
}

java {
sourceCompatibility = JavaVersion.VERSION_16
targetCompatibility = JavaVersion.VERSION_16
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

val compileKotlin: KotlinCompile by tasks
compileKotlin.kotlinOptions.jvmTarget = JavaVersion.VERSION_16.toString()
compileKotlin.kotlinOptions.jvmTarget = JavaVersion.VERSION_17.toString()
12 changes: 8 additions & 4 deletions src/main/kotlin/world/cepi/momentum/Momentum.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,30 @@ package world.cepi.momentum
import net.minestom.server.extensions.Extension
import world.cepi.kstom.command.register
import world.cepi.kstom.command.unregister
import world.cepi.kstom.util.log
import world.cepi.kstom.util.node
import world.cepi.momentum.ability.*
import world.cepi.momentum.command.MovementCommand

class Momentum : Extension() {

override fun initialize() {
override fun initialize(): LoadStatus {
// Register ability manager
abilityManager = AbilityManager(eventNode, *MovementAbility::class.sealedSubclasses.map { it.objectInstance!! }.toTypedArray())
abilityManager = AbilityManager(node, *MovementAbility::class.sealedSubclasses.map { it.objectInstance!! }.toTypedArray())

// register commands
MovementCommand.register()

logger.info("[Momentum] Extension enabled - ${abilityManager.abilities.size} abilities loaded!")
log.info("[Momentum] Extension enabled - ${abilityManager.abilities.size} abilities loaded!")

return LoadStatus.SUCCESS
}

override fun terminate() {

MovementCommand.unregister()

logger.info("[Momentum] Extension disabled!")
log.info("[Momentum] Extension disabled!")
}

companion object {
Expand Down

0 comments on commit af0da5f

Please sign in to comment.