mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-19 04:15:14 -04:00
network: fix explosion reading (1.20.3)
This commit is contained in:
parent
f5cbd31a27
commit
ba1affae6b
@ -44,7 +44,7 @@ class ExplosionS2CP(buffer: PlayInByteBuffer) : PlayS2CPacket {
|
||||
val destruct = if (buffer.versionId >= V_23W45A) buffer.readEnum(DestructionTypes) else null
|
||||
val particle = if (buffer.versionId >= V_23W45A) buffer.readParticleData() else null
|
||||
val emitter = if (buffer.versionId >= V_23W45A) buffer.readParticleData() else null
|
||||
val sound = if (buffer.versionId >= V_23W45A) buffer.readSound() else null
|
||||
val sound = if (buffer.versionId >= V_23W45A) buffer.readNamedSound() else null
|
||||
|
||||
override fun check(connection: PlayConnection) {
|
||||
require(power <= 100.0f) {
|
||||
|
@ -402,7 +402,11 @@ class PlayInByteBuffer : InByteBuffer {
|
||||
if (id != 0) {
|
||||
return PlayedSound(connection.registries.soundEvent[id - 1])
|
||||
}
|
||||
val name = readResourceLocation() // TODO: readRegistryItem?
|
||||
return readNamedSound()
|
||||
}
|
||||
|
||||
fun readNamedSound(): PlayedSound {
|
||||
val name = readResourceLocation()
|
||||
val attenuation = readOptional { readFloat() }
|
||||
return PlayedSound(name, attenuation)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user