Describe the bug
I'm unable to connect to servers if a sound is sent before the world is initialized.
To Reproduce
Steps to reproduce the behavior:
Place a repeating command block playing sounds on a server
Reconnect
Expected behavior
It's expected to join the server normally.
Runtime info (please complete the following information):
OS: Windows
Minecraft version: 1.20.2
Mod version: 1.1.0
Crash reports / logs
java.lang.NullPointerException: Cannot invoke "net.minecraft.client.world.ClientWorld.playSound(net.minecraft.entity.player.PlayerEntity, double, double, double, net.minecraft.registry.entry.RegistryEntry, net.minecraft.sound.SoundCategory, float, float, long)" because "this.client.world" is null
at net.minecraft.client.network.ClientPlayNetworkHandler.onPlaySound(ClientPlayNetworkHandler.java:1779) ~[minecraft-merged-834ae24623-1.20.2-net.fabricmc.yarn.1_20_2.1.20.2+build.4-v2.jar:?]
at net.minecraft.network.packet.s2c.play.PlaySoundS2CPacket.apply(PlaySoundS2CPacket.java:89) ~[minecraft-merged-834ae24623-1.20.2-net.fabricmc.yarn.1_20_2.1.20.2+build.4-v2.jar:?]
at net.minecraft.network.packet.s2c.play.PlaySoundS2CPacket.apply(PlaySoundS2CPacket.java:23) ~[minecraft-merged-834ae24623-1.20.2-net.fabricmc.yarn.1_20_2.1.20.2+build.4-v2.jar:?]
at net.minecraft.network.ClientConnection.handlePacket(ClientConnection.java:211) ~[minecraft-merged-834ae24623-1.20.2-net.fabricmc.yarn.1_20_2.1.20.2+build.4-v2.jar:?]
Checklist
[x] I am using the official version of the mod.
[x] I tried the latest development version but the issue persists.
[x] I searched for similar open issues and could not find an existing bug report on this.
Describe the bug I'm unable to connect to servers if a sound is sent before the world is initialized.
To Reproduce Steps to reproduce the behavior:
Expected behavior It's expected to join the server normally.
Runtime info (please complete the following information):
Crash reports / logs
Checklist