Skip to content

Commit

Permalink
repo: Update to Minecraft 1.20.4 and Kotlin 1.9.21
Browse files Browse the repository at this point in the history
* Update to Minecraft 1.20.4

* project: Update Kotlin, Gradle and dependencies

---------

Co-authored-by: Jakob K <[email protected]>
  • Loading branch information
MushroomMif and jakobkmar committed Dec 12, 2023
1 parent c13134d commit fcf9822
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 21 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repositories {

allprojects {
group = "net.silkmc"
version = "1.10.2"
version = "1.10.3"
if (this.name.startsWith("silk")) {
description = "Silk is a Minecraft API for Kotlin"
}
Expand Down
15 changes: 7 additions & 8 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,26 @@ repositories {
dependencies {
fun pluginDep(id: String, version: String) = "${id}:${id}.gradle.plugin:${version}"

val kotlinVersion = "1.9.10"
val kotlinVersion = "1.9.21"

compileOnly(kotlin("gradle-plugin", embeddedKotlinVersion))
runtimeOnly(kotlin("gradle-plugin", kotlinVersion))
compileOnly(pluginDep("org.jetbrains.kotlin.plugin.serialization", embeddedKotlinVersion))
runtimeOnly(pluginDep("org.jetbrains.kotlin.plugin.serialization", kotlinVersion))

implementation(pluginDep("fabric-loom", "1.3-SNAPSHOT"))
implementation(pluginDep("io.github.juuxel.loom-vineflower", "1.11.0"))
implementation(pluginDep("com.modrinth.minotaur", "2.8.4"))
implementation(pluginDep("fabric-loom", "1.4-SNAPSHOT"))
implementation(pluginDep("com.modrinth.minotaur", "2.8.7"))

implementation(pluginDep("io.papermc.paperweight.userdev", "1.5.5"))
implementation(pluginDep("xyz.jpenilla.run-paper", "2.1.0"))
implementation(pluginDep("io.papermc.paperweight.userdev", "1.5.11"))
implementation(pluginDep("xyz.jpenilla.run-paper", "2.2.2"))

val compileDokkaVersion = "1.9.0"
val dokkaVersion = "1.9.0"
val dokkaVersion = "1.9.10"

compileOnly("org.jetbrains.dokka:dokka-gradle-plugin:$compileDokkaVersion")
runtimeOnly("org.jetbrains.dokka:dokka-gradle-plugin:$dokkaVersion")
compileOnly("org.jetbrains.dokka:dokka-base:$compileDokkaVersion")
runtimeOnly("org.jetbrains.dokka:dokka-base:$dokkaVersion")

implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.2")
}
10 changes: 5 additions & 5 deletions buildSrc/src/main/kotlin/BuildConstants.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ object BuildConstants {
const val majorMinecraftVersion = "1.20"

// check these values here: https://jakobk.net/mcdev
const val minecraftVersion = "1.20.2-rc1"
const val fabricLoaderVersion = "0.14.22"
const val fabricLanguageKotlinVersion = "1.10.10+kotlin.1.9.10"
const val minecraftVersion = "1.20.4"
const val fabricLoaderVersion = "0.15.1"
const val fabricLanguageKotlinVersion = "1.10.16+kotlin.1.9.21"

const val kotestVersion = "5.7.1"
const val mockkVersion = "1.13.7"
const val kotestVersion = "5.8.0"
const val mockkVersion = "1.13.8"

val uploadModules = listOf(
"commands",
Expand Down
1 change: 0 additions & 1 deletion buildSrc/src/main/kotlin/mod-build-script.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import kotlinx.serialization.json.Json
plugins {
kotlin("jvm")
id("fabric-loom")
id("io.github.juuxel.loom-vineflower")
}

repositories {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,24 @@ package net.silkmc.silk.game.sideboard.internal
import kotlinx.coroutines.*
import kotlinx.coroutines.flow.MutableSharedFlow
import net.minecraft.network.chat.Component
import net.minecraft.network.chat.numbers.BlankFormat
import net.minecraft.network.protocol.Packet
import net.minecraft.network.protocol.game.ClientboundResetScorePacket
import net.minecraft.network.protocol.game.ClientboundSetDisplayObjectivePacket
import net.minecraft.network.protocol.game.ClientboundSetObjectivePacket
import net.minecraft.network.protocol.game.ClientboundSetPlayerTeamPacket
import net.minecraft.network.protocol.game.ClientboundSetScorePacket
import net.minecraft.server.ServerScoreboard
import net.minecraft.server.level.ServerPlayer
import net.minecraft.world.scores.DisplaySlot
import net.minecraft.world.scores.Objective
import net.minecraft.world.scores.PlayerTeam
import net.minecraft.world.scores.Scoreboard
import net.minecraft.world.scores.criteria.ObjectiveCriteria
import net.silkmc.silk.core.annotations.InternalSilkApi
import net.silkmc.silk.core.event.Events
import net.silkmc.silk.core.event.Player
import net.silkmc.silk.core.kotlin.LimitedAccessWrapper
import net.silkmc.silk.core.task.silkCoroutineScope
import net.silkmc.silk.core.text.literal
import java.util.*
import java.util.concurrent.ConcurrentHashMap

Expand Down Expand Up @@ -51,7 +52,7 @@ class SideboardScoreboard(
}
}

private val dummyObjective = Objective(NoopScoreboard, name, ObjectiveCriteria.DUMMY, displayName, ObjectiveCriteria.RenderType.INTEGER)
private val dummyObjective = Objective(NoopScoreboard, name, ObjectiveCriteria.DUMMY, displayName, ObjectiveCriteria.RenderType.INTEGER, false, BlankFormat.INSTANCE)

// scoreboard state
private val lines = LimitedAccessWrapper(ArrayList<Line>())
Expand Down Expand Up @@ -141,7 +142,7 @@ class SideboardScoreboard(

suspend fun createInitPackets(score: Int): List<Packet<*>> {
return buildList {
add(ClientboundSetScorePacket(ServerScoreboard.Method.CHANGE, dummyObjective.name, fakePlayerName, score))
add(ClientboundSetScorePacket(fakePlayerName, dummyObjective.name, score, fakePlayerName.literal, BlankFormat.INSTANCE))
wrappedTeam.access { team ->
add(ClientboundSetPlayerTeamPacket.createAddOrModifyPacket(team, true))
}
Expand All @@ -151,7 +152,7 @@ class SideboardScoreboard(

fun createRemovePackets(): List<Packet<*>> {
return buildList {
add(ClientboundSetScorePacket(ServerScoreboard.Method.REMOVE, dummyObjective.name, fakePlayerName, 0))
add(ClientboundResetScorePacket(fakePlayerName, dummyObjective.name))
add(ClientboundSetPlayerTeamPacket.createRemovePacket(unsafeTeam))
}
}
Expand Down

0 comments on commit fcf9822

Please sign in to comment.