EntitySpawnExtension causes IllegalReferenceCountException on Fabric client
Qumoo opened this issue ยท 1 comments
When using the EntitySpawnExtension we're running into an IllegalReferenceCountException on the Fabric client.
The code we're using can be found here: https://gitlab.com/cable-mc/pokemon-cobbled/-/blob/41e4a88c389bf76871b9c54fbc536129b9313702/common/src/main/kotlin/com/cablemc/pokemoncobbled/common/entity/pokemon/PokemonEntity.kt
And the stacktrace is:
[07:25:46] [Render thread/FATAL] (Minecraft) Error executing task on Client
io.netty.util.IllegalReferenceCountException: refCnt: 0
at io.netty.buffer.AbstractByteBuf.ensureAccessible(AbstractByteBuf.java:1454) ~[netty-all-4.1.68.Final.jar:4.1.68.Final]
at io.netty.buffer.AbstractByteBuf.checkReadableBytes0(AbstractByteBuf.java:1440) ~[netty-all-4.1.68.Final.jar:4.1.68.Final]
at io.netty.buffer.AbstractByteBuf.readInt(AbstractByteBuf.java:809) ~[netty-all-4.1.68.Final.jar:4.1.68.Final]
at io.netty.buffer.AbstractByteBuf.readFloat(AbstractByteBuf.java:856) ~[netty-all-4.1.68.Final.jar:4.1.68.Final]
at net.minecraft.network.FriendlyByteBuf.readFloat(FriendlyByteBuf.java:1042) ~[[email protected]:?]
at com.cablemc.pokemoncobbled.common.entity.pokemon.PokemonEntity.loadAdditionalSpawnData(PokemonEntity.java:209) ~[2953412868271822787.jar:?]
at dev.architectury.networking.fabric.SpawnEntityPacket$Client.lambda$receive$0(SpawnEntityPacket.java:106) ~[architectury-fabric-3.7.22.jar:?]
at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:146) [[email protected]:?]
at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:29) [[email protected]:?]
at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:122) [[email protected]:?]
at net.minecraft.util.thread.BlockableEventLoop.runAllTasks(BlockableEventLoop.java:116) [[email protected]:?]
at net.minecraft.client.Minecraft.runTick(Minecraft.java:932) [[email protected]:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:641) [[email protected]:?]
at net.minecraft.client.main.Main.main(Main.java:212) [[email protected]:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:416) [fabric-loader-0.13.2.jar:?]
at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:77) [fabric-loader-0.13.2.jar:?]
at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) [fabric-loader-0.13.2.jar:?]
at net.fabricmc.devlaunchinjector.Main.main(Main.java:86) [dev-launch-injector-0.2.1+build.8.jar:?]
at dev.architectury.transformer.TransformerRuntime.main(TransformerRuntime.java:217) [architectury-transformer-5.2.61-runtime.jar:5.2.61]