update via

This commit is contained in:
creeper123123321 2023-02-18 10:25:32 -03:00
parent 1ae643634f
commit d407dd2002
2 changed files with 20 additions and 25 deletions

View File

@ -60,13 +60,13 @@ dependencies {
implementation(kotlin("stdlib-jdk8")) implementation(kotlin("stdlib-jdk8"))
implementation(kotlin("reflect")) implementation(kotlin("reflect"))
val vvVer = "4.6.0-23w03a-SNAPSHOT" val vvVer = "4.6.0-23w07a-SNAPSHOT"
val vbVer = "4.6.0-23w03a-SNAPSHOT" val vbVer = "4.6.0-23w07a-SNAPSHOT"
val vrVer = "9e4ac93" val vrVer = "9e4ac93"
implementation("com.viaversion:viaversion:$vvVer") { isTransitive = false } implementation("com.viaversion:viaversion:$vvVer") { isTransitive = false }
implementation("com.viaversion:viabackwards:$vbVer") { isTransitive = false } implementation("com.viaversion:viabackwards:$vbVer") { isTransitive = false }
implementation("com.github.ViaVersion.ViaRewind:viarewind-all:$vrVer") { isTransitive = false } implementation("com.github.ViaVersion.ViaRewind:viarewind-all:$vrVer") { isTransitive = false }
implementation("net.raphimc:ViaAprilFools:2.0.1") implementation("net.raphimc:ViaAprilFools:2.0.4")
val nettyVer = "4.1.86.Final" val nettyVer = "4.1.86.Final"
implementation("io.netty:netty-handler-proxy:$nettyVer") implementation("io.netty:netty-handler-proxy:$nettyVer")
@ -95,7 +95,7 @@ dependencies {
implementation("org.jline:jline-terminal-jansi:3.21.0") implementation("org.jline:jline-terminal-jansi:3.21.0")
implementation("org.slf4j:slf4j-api:$slf4jVer") implementation("org.slf4j:slf4j-api:$slf4jVer")
val ktorVersion = "2.2.2" val ktorVersion = "2.2.3"
implementation("io.ktor:ktor-network-tls-certificates-jvm:$ktorVersion") implementation("io.ktor:ktor-network-tls-certificates-jvm:$ktorVersion")
implementation("io.ktor:ktor-server-websockets:$ktorVersion") implementation("io.ktor:ktor-server-websockets:$ktorVersion")
implementation("io.ktor:ktor-server-netty-jvm:$ktorVersion") implementation("io.ktor:ktor-server-netty-jvm:$ktorVersion")

View File

@ -5,6 +5,7 @@ import com.viaversion.aas.protocol.id47toid5.Protocol1_8To1_7_6
import com.viaversion.aas.protocol.id47toid5.chunks.ChunkPacketTransformer import com.viaversion.aas.protocol.id47toid5.chunks.ChunkPacketTransformer
import com.viaversion.aas.protocol.id47toid5.data.Particle1_8to1_7 import com.viaversion.aas.protocol.id47toid5.data.Particle1_8to1_7
import com.viaversion.aas.protocol.id47toid5.storage.MapStorage import com.viaversion.aas.protocol.id47toid5.storage.MapStorage
import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers
import com.viaversion.viaversion.api.protocol.remapper.PacketRemapper import com.viaversion.viaversion.api.protocol.remapper.PacketRemapper
import com.viaversion.viaversion.api.protocol.remapper.TypeRemapper import com.viaversion.viaversion.api.protocol.remapper.TypeRemapper
import com.viaversion.viaversion.api.type.Type import com.viaversion.viaversion.api.type.Type
@ -17,21 +18,17 @@ import de.gerrygames.viarewind.protocol.protocol1_7_6_10to1_8.types.Types1_7_6_1
import kotlin.experimental.and import kotlin.experimental.and
fun Protocol1_8To1_7_6.registerWorldPackets() { fun Protocol1_8To1_7_6.registerWorldPackets() {
this.registerClientbound(ClientboundPackets1_7.CHUNK_DATA, object : PacketRemapper() { this.registerClientbound(ClientboundPackets1_7.CHUNK_DATA) { packetWrapper ->
override fun registerMap() { ChunkPacketTransformer.transformChunk(packetWrapper)
handler { packetWrapper -> ChunkPacketTransformer.transformChunk(packetWrapper) }
} }
})
//Multi Block Change //Multi Block Change
this.registerClientbound(ClientboundPackets1_7.MULTI_BLOCK_CHANGE, object : PacketRemapper() { this.registerClientbound(ClientboundPackets1_7.MULTI_BLOCK_CHANGE) { packetWrapper ->
override fun registerMap() { ChunkPacketTransformer.transformMultiBlockChange(packetWrapper)
handler { packetWrapper -> ChunkPacketTransformer.transformMultiBlockChange(packetWrapper) }
} }
})
this.registerClientbound(ClientboundPackets1_7.BLOCK_CHANGE, object : PacketRemapper() { this.registerClientbound(ClientboundPackets1_7.BLOCK_CHANGE, object : PacketHandlers() {
override fun registerMap() { override fun register() {
map(xyzUBytePos, TypeRemapper(Type.POSITION)) //Position map(xyzUBytePos, TypeRemapper(Type.POSITION)) //Position
handler { packetWrapper -> handler { packetWrapper ->
val blockId = packetWrapper.read(Type.VAR_INT) val blockId = packetWrapper.read(Type.VAR_INT)
@ -41,8 +38,8 @@ fun Protocol1_8To1_7_6.registerWorldPackets() {
} }
}) })
this.registerClientbound(ClientboundPackets1_7.BLOCK_ACTION, object : PacketRemapper() { this.registerClientbound(ClientboundPackets1_7.BLOCK_ACTION, object : PacketHandlers() {
override fun registerMap() { override fun register() {
map(xyzShortPos, TypeRemapper(Type.POSITION)) //Position map(xyzShortPos, TypeRemapper(Type.POSITION)) //Position
map(Type.UNSIGNED_BYTE) map(Type.UNSIGNED_BYTE)
map(Type.UNSIGNED_BYTE) map(Type.UNSIGNED_BYTE)
@ -58,11 +55,9 @@ fun Protocol1_8To1_7_6.registerWorldPackets() {
} }
}) })
this.registerClientbound(ClientboundPackets1_7.MAP_BULK_CHUNK, object : PacketRemapper() { this.registerClientbound(ClientboundPackets1_7.MAP_BULK_CHUNK) { packetWrapper ->
override fun registerMap() { ChunkPacketTransformer.transformChunkBulk(packetWrapper)
handler { packetWrapper -> ChunkPacketTransformer.transformChunkBulk(packetWrapper) }
} }
})
this.registerClientbound(ClientboundPackets1_7.EFFECT, object : PacketRemapper() { this.registerClientbound(ClientboundPackets1_7.EFFECT, object : PacketRemapper() {
override fun registerMap() { override fun registerMap() {
@ -101,14 +96,14 @@ fun Protocol1_8To1_7_6.registerWorldPackets() {
try { try {
toWrite = parts[i + 1].toInt() toWrite = parts[i + 1].toInt()
if (particle.extra == 1 && parts.size == 3) { if (particle.extra == 1 && parts.size == 3) {
++i i++
toWrite = toWrite or (parts[i + 1].toInt() shl 12) toWrite = toWrite or (parts[i + 1].toInt() shl 12)
} }
} catch (ignored: NumberFormatException) { } catch (ignored: NumberFormatException) {
} }
} }
packetWrapper.write(Type.VAR_INT, toWrite) packetWrapper.write(Type.VAR_INT, toWrite)
++i i++
} }
} }
} }