mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-16 10:55:01 -04:00
network: fix initial yaw/pitch reading
Yep, thanks mojang. The values are swapped -/
This commit is contained in:
parent
5d9405828b
commit
4722ef13b6
@ -92,10 +92,10 @@ abstract class PlayerEntity(
|
|||||||
|
|
||||||
protected open fun updateSkinParts(flags: Int) {
|
protected open fun updateSkinParts(flags: Int) {
|
||||||
for (part in SkinParts.VALUES) {
|
for (part in SkinParts.VALUES) {
|
||||||
if (!flags.isBitMask(part.bitmask)) {
|
if (flags.isBitMask(part.bitmask)) {
|
||||||
skinParts -= part
|
|
||||||
} else {
|
|
||||||
skinParts += part
|
skinParts += part
|
||||||
|
} else {
|
||||||
|
skinParts -= part
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
package de.bixilon.minosoft.protocol.packets.s2c.play.entity.spawn
|
package de.bixilon.minosoft.protocol.packets.s2c.play.entity.spawn
|
||||||
|
|
||||||
import de.bixilon.kotlinglm.vec3.Vec3d
|
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.data.entities.entities.Entity
|
||||||
import de.bixilon.minosoft.protocol.network.connection.play.PlayConnection
|
import de.bixilon.minosoft.protocol.network.connection.play.PlayConnection
|
||||||
import de.bixilon.minosoft.protocol.packets.s2c.PlayS2CPacket
|
import de.bixilon.minosoft.protocol.packets.s2c.PlayS2CPacket
|
||||||
@ -42,7 +43,9 @@ class EntityObjectSpawnS2CP(buffer: PlayInByteBuffer) : PlayS2CPacket {
|
|||||||
buffer.readVarInt()
|
buffer.readVarInt()
|
||||||
}
|
}
|
||||||
val position: Vec3d = buffer.readVec3d()
|
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) {
|
if (buffer.versionId >= ProtocolVersions.V_22W14A) {
|
||||||
val headYaw = buffer.readAngle()
|
val headYaw = buffer.readAngle()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user