From 8345d6f66f841df81b0ccc4da80e11d7aef38dc4 Mon Sep 17 00:00:00 2001 From: senseiwells Date: Sun, 22 Dec 2024 22:31:39 +0100 Subject: [PATCH] Fix polymer compatability again (again) --- build.gradle.kts | 2 +- .../me/senseiwells/replay/chunk/ChunkRecorder.kt | 2 +- .../me/senseiwells/replay/player/PlayerRecorder.kt | 4 ++-- .../me/senseiwells/replay/recorder/ChunkSender.kt | 14 +++++++------- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 4ac6094..6a038a7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -29,7 +29,7 @@ repositories { } -val modVersion = "1.2.9" +val modVersion = "1.2.10" val releaseVersion = "${modVersion}+mc${libs.versions.minecraft.get()}" version = releaseVersion group = "me.senseiwells" diff --git a/src/main/kotlin/me/senseiwells/replay/chunk/ChunkRecorder.kt b/src/main/kotlin/me/senseiwells/replay/chunk/ChunkRecorder.kt index 41de633..bc01994 100644 --- a/src/main/kotlin/me/senseiwells/replay/chunk/ChunkRecorder.kt +++ b/src/main/kotlin/me/senseiwells/replay/chunk/ChunkRecorder.kt @@ -259,7 +259,7 @@ class ChunkRecorder internal constructor( * * @param packet The packet to be recorded. */ - override fun sendPacket(packet: Packet<*>) { + override fun sendChunkPacket(packet: Packet<*>) { this.record(packet) } diff --git a/src/main/kotlin/me/senseiwells/replay/player/PlayerRecorder.kt b/src/main/kotlin/me/senseiwells/replay/player/PlayerRecorder.kt index 5091a8b..3e99fe5 100644 --- a/src/main/kotlin/me/senseiwells/replay/player/PlayerRecorder.kt +++ b/src/main/kotlin/me/senseiwells/replay/player/PlayerRecorder.kt @@ -157,7 +157,7 @@ class PlayerRecorder internal constructor( * * @param packet The packet to be recorded. */ - override fun sendPacket(packet: Packet<*>) { + override fun sendChunkPacket(packet: Packet<*>) { this.record(PolymerPacketPatcher.replace(this.getPlayerOrThrow().connection, packet)) } @@ -185,7 +185,7 @@ class PlayerRecorder internal constructor( override fun addTrackedEntity(tracked: ChunkSender.WrappedTrackedEntity) { val list = ArrayList>() tracked.getServerEntity().sendPairingData(this.getPlayerOrThrow(), list::add) - this.record(ClientboundBundlePacket(list)) + this.sendChunkPacket(ClientboundBundlePacket(list)) } /** diff --git a/src/main/kotlin/me/senseiwells/replay/recorder/ChunkSender.kt b/src/main/kotlin/me/senseiwells/replay/recorder/ChunkSender.kt index 8f175a1..a2ad382 100644 --- a/src/main/kotlin/me/senseiwells/replay/recorder/ChunkSender.kt +++ b/src/main/kotlin/me/senseiwells/replay/recorder/ChunkSender.kt @@ -65,7 +65,7 @@ interface ChunkSender { * * @param packet The packet to send. */ - fun sendPacket(packet: Packet<*>) + fun sendChunkPacket(packet: Packet<*>) /** * This is called when [shouldTrackEntity] returns `true`, @@ -111,9 +111,9 @@ interface ChunkSender { @Internal fun sendChunkViewDistance() { val center = this.getCenterChunk() - this.sendPacket(ClientboundSetChunkCacheCenterPacket(center.x, center.z)) - this.sendPacket(ClientboundSetChunkCacheRadiusPacket(this.getViewDistance())) - this.sendPacket(ClientboundSetSimulationDistancePacket(this.getViewDistance())) + this.sendChunkPacket(ClientboundSetChunkCacheCenterPacket(center.x, center.z)) + this.sendChunkPacket(ClientboundSetChunkCacheRadiusPacket(this.getViewDistance())) + this.sendChunkPacket(ClientboundSetSimulationDistancePacket(this.getViewDistance())) } /** @@ -152,7 +152,7 @@ interface ChunkSender { // We don't need to use the chunkSender // We are only writing the packets to disk... - this.sendPacket(ClientboundLevelChunkWithLightPacket( + this.sendChunkPacket(ClientboundLevelChunkWithLightPacket( chunk, chunk.level.lightEngine, null, @@ -184,10 +184,10 @@ interface ChunkSender { } for (entity in leashed) { - this.sendPacket(ClientboundSetEntityLinkPacket(entity, entity.leashHolder)) + this.sendChunkPacket(ClientboundSetEntityLinkPacket(entity, entity.leashHolder)) } for (entity in ridden) { - this.sendPacket(ClientboundSetPassengersPacket(entity)) + this.sendChunkPacket(ClientboundSetPassengersPacket(entity)) } this.onChunkSent(chunk)