diff --git a/gradle.properties b/gradle.properties index 2d46923..aeb1fc0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,25 +7,25 @@ org.gradle.warning.mode = all # Kotlin - https://kotlinlang.org/docs/releases.html#release-details kotlin.code.style = official -systemProp.kotlin_version = 1.8.22 +systemProp.kotlin_version = 1.9.10 # Fabric - https://fabricmc.net/develop/ -minecraft_version = 1.20.1 -yarn_mappings = 1.20.1+build.10 +minecraft_version = 1.20.2 +yarn_mappings = 1.20.2+build.2 loader_version = 0.14.22 -fabric_version = 0.86.1+1.20.1 -loom_version = 1.3-SNAPSHOT +fabric_version = 0.89.2+1.20.2 +loom_version = 1.4-SNAPSHOT # Kotlin support for Fabric - https://github.com/FabricMC/fabric-language-kotlin -fabric_language_kotlin_version = 1.9.6+kotlin.1.8.22 +fabric_language_kotlin_version = 1.10.10+kotlin.1.9.10 # Kotlin JSON Seralization - https://mvnrepository.com/artifact/org.jetbrains.kotlinx/kotlinx-serialization-json -kotlinx_serialization_json_version = 1.5.1 +kotlinx_serialization_json_version = 1.6.0 # My callbacks - https://github.com/viral32111/events events_version = 0.4.3 # Mod properties -mod_version = 1.0.2 +mod_version = 1.0.3 maven_group = com.viral32111 archives_base_name = progression diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 17a8ddc..c30b486 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/kotlin/com/viral32111/progression/ProgressionState.kt b/src/main/kotlin/com/viral32111/progression/ProgressionState.kt index afd4462..b6daf6b 100644 --- a/src/main/kotlin/com/viral32111/progression/ProgressionState.kt +++ b/src/main/kotlin/com/viral32111/progression/ProgressionState.kt @@ -8,7 +8,7 @@ import net.minecraft.nbt.NbtList import net.minecraft.nbt.NbtString import net.minecraft.server.MinecraftServer import net.minecraft.world.PersistentState -import java.util.UUID +import java.util.* // https://www.fabricmc.net/wiki/tutorial:persistent_states @@ -17,9 +17,11 @@ class ProgressionState : PersistentState() { private const val KEY_EXPERIENCE_COUNTER = "experienceCounter" private const val KEY_PLAYERS_HIDING_BOSS_BAR = "playersHidingProgressBar" + private val myType: Type = Type({ ProgressionState() }, ProgressionState::createFromNbt, null ) + fun getProgressionState( server: MinecraftServer ): ProgressionState? { val persistentStateManager = server.overworld?.persistentStateManager - return persistentStateManager?.getOrCreate( ::createFromNbt, { ProgressionState() }, MOD_ID ) + return persistentStateManager?.getOrCreate( myType, MOD_ID ) } private fun createFromNbt( nbt: NbtCompound ): ProgressionState {