Bug report: Crash with DisguiseLib with non-LivingEntity [Fabric]
woalk opened this issue ยท 0 comments
Describe the bug
DisguiseLib crashes the server if an NPC whose type
has been set to an entity that does not extend LivingEntity
is in a loaded chunk.
Platform(s)
- Fabric
- Forge
Environment(s)
- Singleplayer
- Server
Versions
- Minecraft 1.19.2
- Taterzens 1.11.0
To Reproduce
Steps to reproduce the behavior:
- Launch server with Taterzens and DisguiseLib
- Run
/npc create
- Run
/npc edit type minecraft:boat
- Server hangs and crashes
Expected behavior
The mod should only allow entities that extend LivingEntity
to be selected as NPC type, and display an error when trying to set the NPC type to a non-living entity, to prevent crashes.
Logs
Logs
---- Minecraft Crash Report ----
// Sorry :(
Time: 2023-04-01 21:59:12
Description: Sending packet
java.lang.ClassCastException: class net.minecraft.class_1690 cannot be cast to class net.minecraft.class_1309 (net.minecraft.class_1690 and net.minecraft.class_1309 are in unnamed module of loader net.fabricmc.loader.impl.launch.knot.KnotClassLoader @dfd3711)
at xyz.nucleoid.disguiselib.impl.packets.FakePackets.fakeMobSpawnS2CPacket(FakePackets.java:53)
at xyz.nucleoid.disguiselib.impl.packets.FakePackets.universalSpawnPacket(FakePackets.java:36)
at net.minecraft.class_3244.disguiselib$sendFakePacket(class_3244.java:3678)
at net.minecraft.class_3244.handler$zpi000$disguiseEntity(class_3244.java:3658)
at net.minecraft.class_3244.method_14369(class_3244.java:1256)
at net.minecraft.class_3244.handler$ddo000$changeEntityType(class_3244.java:2102)
at net.minecraft.class_3244.method_14369(class_3244.java:1256)
at net.minecraft.class_3244.method_14364(class_3244.java:1251)
at net.minecraft.class_3231.method_18757(class_3231.java:230)
at net.minecraft.class_3231.method_18760(class_3231.java:220)
at net.minecraft.class_3898$class_3208.method_18736(class_3898.java:1416)
at net.minecraft.class_3898$class_3208.method_18729(class_3898.java:1442)
at net.minecraft.class_3898.method_18701(class_3898.java:1198)
at net.minecraft.class_3215.method_18755(class_3215.java:477)
at net.minecraft.class_3218$class_5526.method_31436(class_3218.java:1560)
at net.minecraft.class_3218$class_5526.method_31798(class_3218.java:1538)
at net.minecraft.class_5579.method_31847(class_5579.java:217)
at net.minecraft.class_5579.method_31820(class_5579.java:187)
at net.minecraft.class_5579.method_31857(class_5579.java:352)
at java.base/java.util.Collections$2.tryAdvance(Collections.java:4853)
at java.base/java.util.Collections$2.forEachRemaining(Collections.java:4861)
at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
at net.minecraft.class_5579.method_31853(class_5579.java:352)
at net.minecraft.class_5579.method_31809(class_5579.java:358)
at net.minecraft.class_3218.method_18765(class_3218.java:380)
at net.minecraft.server.MinecraftServer.method_3813(MinecraftServer.java:875)
at net.minecraft.class_3176.method_3813(class_3176.java:289)
at net.minecraft.server.MinecraftServer.method_3748(MinecraftServer.java:819)
at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:665)
at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:257)
at java.base/java.lang.Thread.run(Thread.java:833)
Additional context
/