network: fix initial yaw/pitch reading

Yep, thanks mojang. The values are swapped -/
This commit is contained in:
Moritz Zwerger 2023-10-30 00:45:00 +01:00
parent 5d9405828b
commit 4722ef13b6
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
2 changed files with 7 additions and 4 deletions

View File

@ -92,10 +92,10 @@ abstract class PlayerEntity(
protected open fun updateSkinParts(flags: Int) {
for (part in SkinParts.VALUES) {
if (!flags.isBitMask(part.bitmask)) {
skinParts -= part
} else {
if (flags.isBitMask(part.bitmask)) {
skinParts += part
} else {
skinParts -= part
}
}
}

View File

@ -13,6 +13,7 @@
package de.bixilon.minosoft.protocol.packets.s2c.play.entity.spawn
import de.bixilon.kotlinglm.vec3.Vec3d
import de.bixilon.minosoft.data.entities.EntityRotation
import de.bixilon.minosoft.data.entities.entities.Entity
import de.bixilon.minosoft.protocol.network.connection.play.PlayConnection
import de.bixilon.minosoft.protocol.packets.s2c.PlayS2CPacket
@ -42,7 +43,9 @@ class EntityObjectSpawnS2CP(buffer: PlayInByteBuffer) : PlayS2CPacket {
buffer.readVarInt()
}
val position: Vec3d = buffer.readVec3d()
val rotation = buffer.readEntityRotation() // ToDo: Is yaw/pitch swapped?
val pitch = buffer.readAngle() // yaw/pitch is swapped
val yaw = buffer.readAngle()
val rotation = EntityRotation(yaw, pitch)
if (buffer.versionId >= ProtocolVersions.V_22W14A) {
val headYaw = buffer.readAngle()
}