From 8d9182bf39429414bc4e40295fbf6c1533e5008c Mon Sep 17 00:00:00 2001 From: FlerBuster <96306683+FlerBuster@users.noreply.github.com> Date: Tue, 7 Jan 2025 17:30:02 +0100 Subject: [PATCH] 1.21.1 update --- buildSrc/src/main/kotlin/BuildConstants.kt | 4 ++-- .../net/silkmc/silk/compose/impl/ItemFrameMapsComposeGui.kt | 4 +++- .../kotlin/net/silkmc/silk/compose/internal/AssetsLoader.kt | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/buildSrc/src/main/kotlin/BuildConstants.kt b/buildSrc/src/main/kotlin/BuildConstants.kt index bf16eae..2d7512f 100644 --- a/buildSrc/src/main/kotlin/BuildConstants.kt +++ b/buildSrc/src/main/kotlin/BuildConstants.kt @@ -1,5 +1,5 @@ val githubRepo = "SilkMC/silk-compose" -val minecraftVersion = "1.20.6" +val minecraftVersion = "1.21.1" object Deps { // https://fabricmc.net/develop/ @@ -12,7 +12,7 @@ object Deps { // https://github.com/SilkMC/silk object Silk { - val silkVersion = "1.10.5" + val silkVersion = "1.10.7" val core = "net.silkmc:silk-core:$silkVersion" val commands = "net.silkmc:silk-commands:$silkVersion" } diff --git a/silk-compose/src/main/kotlin/net/silkmc/silk/compose/impl/ItemFrameMapsComposeGui.kt b/silk-compose/src/main/kotlin/net/silkmc/silk/compose/impl/ItemFrameMapsComposeGui.kt index 98645df..bc4f157 100644 --- a/silk-compose/src/main/kotlin/net/silkmc/silk/compose/impl/ItemFrameMapsComposeGui.kt +++ b/silk-compose/src/main/kotlin/net/silkmc/silk/compose/impl/ItemFrameMapsComposeGui.kt @@ -13,6 +13,7 @@ import net.minecraft.core.BlockPos import net.minecraft.core.Direction import net.minecraft.core.component.DataComponents import net.minecraft.network.protocol.game.* +import net.minecraft.server.level.ServerEntity import net.minecraft.server.level.ServerPlayer import net.minecraft.world.InteractionHand import net.minecraft.world.entity.decoration.GlowItemFrame @@ -187,7 +188,8 @@ class ItemFrameMapsComposeGui( // spawn the fake item frame val itemFrame = GlowItemFrame(player.level(), framePos, guiDirection) itemFrame.isInvisible = true - connection.send(itemFrame.addEntityPacket) + val playerServerEntity = ServerEntity(player.serverLevel(), player, 0, true) { } + connection.send(itemFrame.getAddEntityPacket(playerServerEntity)) entityIds.add(itemFrame.id) // put the map in the item frame diff --git a/silk-compose/src/main/kotlin/net/silkmc/silk/compose/internal/AssetsLoader.kt b/silk-compose/src/main/kotlin/net/silkmc/silk/compose/internal/AssetsLoader.kt index 081221a..5eae923 100644 --- a/silk-compose/src/main/kotlin/net/silkmc/silk/compose/internal/AssetsLoader.kt +++ b/silk-compose/src/main/kotlin/net/silkmc/silk/compose/internal/AssetsLoader.kt @@ -22,7 +22,8 @@ import kotlin.io.path.isDirectory import kotlin.io.path.pathString object AssetsLoader { - private val assetsStorage = (Silk.currentServer?.serverDirectory ?: File(".")).resolve("server-assets/") + private val assetStorageParentPath = (Silk.currentServer?.serverDirectory ?: File(".").toPath()) + private val assetsStorage = assetStorageParentPath.resolve("server-assets/").toFile() private val assetsPath = assetsStorage.toPath().resolve("assets") private val loadedAssets = CompletableDeferred()