network: fix 1.8 PositionRotationS2CP reading

This commit is contained in:
Bixilon 2023-03-20 23:22:05 +01:00
parent 2a78b941d3
commit f786af9178
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
2 changed files with 2 additions and 6 deletions

View File

@ -27,7 +27,7 @@ import de.bixilon.minosoft.util.logging.LogLevels
import de.bixilon.minosoft.util.logging.LogMessageType
class PositionRotationS2CP(buffer: PlayInByteBuffer) : PlayS2CPacket {
val position: Vec3d = buffer.readVec3d()
val position: Vec3d = Vec3d(buffer.readDoubleArray(3))
val rotation: EntityRotation
var onGround = false
private var flags: Int = 0

View File

@ -23,11 +23,7 @@ import de.bixilon.minosoft.util.logging.LogMessageType
class TeleportS2CP(buffer: PlayInByteBuffer) : PlayS2CPacket {
val entityId: Int = buffer.readEntityId()
val position: Vec3d = if (buffer.versionId < ProtocolVersions.V_16W06A) {
Vec3d(buffer.readFixedPointNumberInt(), buffer.readFixedPointNumberInt(), buffer.readFixedPointNumberInt())
} else {
buffer.readVec3d()
}
val position: Vec3d = buffer.readVec3d()
val rotation = buffer.readEntityRotation()
val onGround = if (buffer.versionId >= ProtocolVersions.V_14W25B) {
buffer.readBoolean()