mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-14 18:05:51 -04:00
fix 1.7 network errors, read/handle legacy tab list correctly
This commit is contained in:
parent
bc315053c6
commit
cf8c427af1
@ -32,7 +32,7 @@ import java.util.*
|
|||||||
|
|
||||||
class EntityPlayerS2CP(buffer: PlayInByteBuffer) : PlayS2CPacket {
|
class EntityPlayerS2CP(buffer: PlayInByteBuffer) : PlayS2CPacket {
|
||||||
val entityId: Int
|
val entityId: Int
|
||||||
val entityUUID: UUID?
|
val entityUUID: UUID
|
||||||
val entity: PlayerEntity
|
val entity: PlayerEntity
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
@ -33,7 +33,7 @@ class NamedSoundS2CP(buffer: PlayInByteBuffer) : PlayS2CPacket {
|
|||||||
val pitch: Float
|
val pitch: Float
|
||||||
lateinit var position: Vec3d
|
lateinit var position: Vec3d
|
||||||
private set
|
private set
|
||||||
lateinit var category: SoundCategories
|
var category: SoundCategories? = null
|
||||||
private set
|
private set
|
||||||
var seed: Long = 0L
|
var seed: Long = 0L
|
||||||
private set
|
private set
|
||||||
|
@ -12,7 +12,9 @@
|
|||||||
*/
|
*/
|
||||||
package de.bixilon.minosoft.protocol.packets.s2c.play.tab
|
package de.bixilon.minosoft.protocol.packets.s2c.play.tab
|
||||||
|
|
||||||
|
import de.bixilon.minosoft.data.entities.entities.player.additional.AdditionalDataUpdate
|
||||||
import de.bixilon.minosoft.data.entities.entities.player.additional.PlayerAdditional
|
import de.bixilon.minosoft.data.entities.entities.player.additional.PlayerAdditional
|
||||||
|
import de.bixilon.minosoft.modding.event.events.TabListEntryChangeEvent
|
||||||
import de.bixilon.minosoft.protocol.ProtocolUtil.encodeNetwork
|
import de.bixilon.minosoft.protocol.ProtocolUtil.encodeNetwork
|
||||||
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
|
||||||
@ -34,9 +36,9 @@ class LegacyTabListS2CP(buffer: PlayInByteBuffer) : PlayS2CPacket {
|
|||||||
buffer.readVarInt()
|
buffer.readVarInt()
|
||||||
}
|
}
|
||||||
if (buffer.readBoolean()) {
|
if (buffer.readBoolean()) {
|
||||||
items[name] = ping // update latency or add
|
|
||||||
} else {
|
|
||||||
items[name] = null // remove
|
items[name] = null // remove
|
||||||
|
} else {
|
||||||
|
items[name] = ping // update latency or add
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,6 +60,7 @@ class LegacyTabListS2CP(buffer: PlayInByteBuffer) : PlayS2CPacket {
|
|||||||
connection.tabList.name[name] = item
|
connection.tabList.name[name] = item
|
||||||
}
|
}
|
||||||
item.ping = ping
|
item.ping = ping
|
||||||
|
connection.events.fire(TabListEntryChangeEvent(connection, mapOf(uuid to AdditionalDataUpdate(ping = ping))))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user