Closed Novalescent closed 18 hours ago
I can't replicate, can you reproduce the issue then use /ld logs
and give the output of that command.
My log file: https://mclo.gs/rjFNJ1z, my combined config files: https://mclo.gs/hFyXeeh and my disguises file: https://mclo.gs/E0klCN4
After some more testing, I realized that it doesn't happen on those conditions, but can be replicated by repeatedly spawning in a zombie and then disguising it as a player immediately. Eventually one of the spawns would crash me I do this via the LibDisguises API, first by spawning the entity and then applying the disguise:
String randomName = RandomStringUtils.randomAlphanumeric(16);
SkinData skinData = npc.getSkinModule().getSkinPack().getRandomSkin();
PlayerDisguise disguise = new PlayerDisguise(randomName).setSkin(new UserProfile(UUID.randomUUID(), randomName,
List.of(new TextureProperty("textures", skinData.getSkinValue(), skinData.getSkinSignature())))).setNameVisible(false);
disguise.setReplaceSounds(false);
FlagWatcher watcher = disguise.getWatcher();
watcher.setCustomNameVisible(false);
disguise.setEntity(entity);
disguise.startDisguise();```
Ah yeah, so its more accurate to describe this as LD being too eager to transform packets immediately, before the disguise has a chance to be sent to the client.
Frankly most of your issues with this come from not using DisguiseAPI.disguiseNextEntity
if you're going to be spawning and disguising it immediately. But it also has a (substantially) rarer chance to happen naturally. Plus more people are doubtlessly doing the approach of spawning then applying a disguise, than the aforementioned disguiseNextEntity.
For clarity, the approach of disguiseNextEntity is basically that you create the disguise, call that method, then immediately spawn your entity. So there's no split second where the client may see the actual entity.
This is really good to know. I'll test this out and let you know if I encounter any other issues. Thanks!
I'm encountering 2 bugs with disguiseNextEntity.
First, whenever I call that method and immediately spawn the entity afterwards, it doesn't disguise the entity at all. I checked and it's because it's not getting the next entity ID to spawn, just the one that the counter is currently on, so I have to manually get the next value and then use the utilities method to disguise it.
The other issue is that I'm getting an error upon doing this that is caused by the main packet listener, which is throwing an error for trying to get all entities asynchronously. This causes the entity to not be disguised immediately upon spawning and it has to wait a second for it to happen.
java.lang.Throwable: null
at org.spigotmc.AsyncCatcher.catchOp(AsyncCatcher.java:14) ~[paper-1.21.3.jar:1.21.3-DEV-3c9a018]
at net.minecraft.server.level.ServerLevel.getEntities(ServerLevel.java:2506) ~[paper-1.21.3.jar:1.21.3-DEV-3c9a018]
at org.bukkit.craftbukkit.CraftWorld.getNMSEntities(CraftWorld.java:1094) ~[paper-1.21.3.jar:1.21.3-DEV-3c9a018]
at org.bukkit.craftbukkit.CraftRegionAccessor.getEntities(CraftRegionAccessor.java:318) ~[paper-1.21.3.jar:1.21.3-DEV-3c9a018]
at LibsDisguises (6).jar/me.libraryaddict.disguise.utilities.DisguiseUtilities.getDisguise(DisguiseUtilities.java:3681) ~[LibsDisguises (6).jar:?]
at LibsDisguises (6).jar/me.libraryaddict.disguise.utilities.packets.packetlisteners.PacketListenerMain.onPacketPlaySend(PacketListenerMain.java:52) ~[LibsDisguises (6).jar:?]
at packetevents-spigot-2.6.1-SNAPSHOT.jar/com.github.retrooper.packetevents.event.SimplePacketListenerAbstract.onPacketSend(SimplePacketListenerAbstract.java:64) ~[packetevents-spigot-2.6.1-SNAPSHOT.jar:?]
at packetevents-spigot-2.6.1-SNAPSHOT.jar/com.github.retrooper.packetevents.event.PacketSendEvent.call(PacketSendEvent.java:51) ~[packetevents-spigot-2.6.1-SNAPSHOT.jar:?]
at packetevents-spigot-2.6.1-SNAPSHOT.jar/com.github.retrooper.packetevents.event.EventManager.callEvent(EventManager.java:84) ~[packetevents-spigot-2.6.1-SNAPSHOT.jar:?]
at packetevents-spigot-2.6.1-SNAPSHOT.jar/com.github.retrooper.packetevents.util.PacketEventsImplHelper.handleClientBoundPacket(PacketEventsImplHelper.java:61) ~[packetevents-spigot-2.6.1-SNAPSHOT.jar:?]
at packetevents-spigot-2.6.1-SNAPSHOT.jar/io.github.retrooper.packetevents.injector.handlers.PacketEventsEncoder.handleClientBoundPacket(PacketEventsEncoder.java:88) ~[packetevents-spigot-2.6.1-SNAPSHOT.jar:?]
at packetevents-spigot-2.6.1-SNAPSHOT.jar/io.github.retrooper.packetevents.injector.handlers.PacketEventsEncoder.encode(PacketEventsEncoder.java:73) ~[packetevents-spigot-2.6.1-SNAPSHOT.jar:?]
at packetevents-spigot-2.6.1-SNAPSHOT.jar/io.github.retrooper.packetevents.injector.handlers.PacketEventsEncoder.encode(PacketEventsEncoder.java:52) ~[packetevents-spigot-2.6.1-SNAPSHOT.jar:?]
at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:90) ~[netty-codec-4.1.97.Final.jar:4.1.97.Final]
at packetevents-spigot-2.6.1-SNAPSHOT.jar/io.github.retrooper.packetevents.injector.handlers.PacketEventsEncoder.write(PacketEventsEncoder.java:107) ~[packetevents-spigot-2.6.1-SNAPSHOT.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:881) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:863) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:968) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:856) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:113) ~[netty-codec-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:881) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:863) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:968) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:856) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:113) ~[netty-codec-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:881) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:863) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:968) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:856) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.ChannelOutboundHandlerAdapter.write(ChannelOutboundHandlerAdapter.java:113) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at net.minecraft.network.Connection$2.write(Connection.java:762) ~[paper-1.21.3.jar:1.21.3-DEV-3c9a018]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:881) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:863) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:968) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:856) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.ChannelDuplexHandler.write(ChannelDuplexHandler.java:115) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at ModelEngine-4.0.8.jar/com.ticxo.modelengine.v1_21_R2.network.ModelEngineChannelHandler.write(ModelEngineChannelHandler.java:110) ~[ModelEngine-4.0.8.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:879) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:863) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:968) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:856) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:851) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.DefaultChannelPipeline.write(DefaultChannelPipeline.java:1010) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannel.write(AbstractChannel.java:296) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at net.minecraft.network.Connection.doSendPacket(Connection.java:513) ~[paper-1.21.3.jar:1.21.3-DEV-3c9a018]
at net.minecraft.network.Connection.lambda$sendPacket$13(Connection.java:498) ~[paper-1.21.3.jar:1.21.3-DEV-3c9a018]
at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) ~[netty-common-4.1.97.Final.jar:4.1.97.Final]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167) ~[netty-common-4.1.97.Final.jar:4.1.97.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) ~[netty-common-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:413) ~[netty-transport-classes-epoll-4.1.97.Final.jar:4.1.97.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.97.Final.jar:4.1.97.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.97.Final.jar:4.1.97.Final]
at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]
[20:34:29 WARN]: [com.github.retrooper.packetevents.PacketEventsAPI] PacketEvents caught an unhandled exception while calling your listener.
java.lang.IllegalStateException: Asynchronous Chunk getEntities call!
at org.spigotmc.AsyncCatcher.catchOp(AsyncCatcher.java:15) ~[paper-1.21.3.jar:1.21.3-DEV-3c9a018]
at net.minecraft.server.level.ServerLevel.getEntities(ServerLevel.java:2506) ~[paper-1.21.3.jar:1.21.3-DEV-3c9a018]
at org.bukkit.craftbukkit.CraftWorld.getNMSEntities(CraftWorld.java:1094) ~[paper-1.21.3.jar:1.21.3-DEV-3c9a018]
at org.bukkit.craftbukkit.CraftRegionAccessor.getEntities(CraftRegionAccessor.java:318) ~[paper-1.21.3.jar:1.21.3-DEV-3c9a018]
at LibsDisguises (6).jar/me.libraryaddict.disguise.utilities.DisguiseUtilities.getDisguise(DisguiseUtilities.java:3681) ~[LibsDisguises (6).jar:?]
at LibsDisguises (6).jar/me.libraryaddict.disguise.utilities.packets.packetlisteners.PacketListenerMain.onPacketPlaySend(PacketListenerMain.java:52) ~[LibsDisguises (6).jar:?]
at packetevents-spigot-2.6.1-SNAPSHOT.jar/com.github.retrooper.packetevents.event.SimplePacketListenerAbstract.onPacketSend(SimplePacketListenerAbstract.java:64) ~[packetevents-spigot-2.6.1-SNAPSHOT.jar:?]
at packetevents-spigot-2.6.1-SNAPSHOT.jar/com.github.retrooper.packetevents.event.PacketSendEvent.call(PacketSendEvent.java:51) ~[packetevents-spigot-2.6.1-SNAPSHOT.jar:?]
at packetevents-spigot-2.6.1-SNAPSHOT.jar/com.github.retrooper.packetevents.event.EventManager.callEvent(EventManager.java:84) ~[packetevents-spigot-2.6.1-SNAPSHOT.jar:?]
at packetevents-spigot-2.6.1-SNAPSHOT.jar/com.github.retrooper.packetevents.util.PacketEventsImplHelper.handleClientBoundPacket(PacketEventsImplHelper.java:61) ~[packetevents-spigot-2.6.1-SNAPSHOT.jar:?]
at packetevents-spigot-2.6.1-SNAPSHOT.jar/io.github.retrooper.packetevents.injector.handlers.PacketEventsEncoder.handleClientBoundPacket(PacketEventsEncoder.java:88) ~[packetevents-spigot-2.6.1-SNAPSHOT.jar:?]
at packetevents-spigot-2.6.1-SNAPSHOT.jar/io.github.retrooper.packetevents.injector.handlers.PacketEventsEncoder.encode(PacketEventsEncoder.java:73) ~[packetevents-spigot-2.6.1-SNAPSHOT.jar:?]
at packetevents-spigot-2.6.1-SNAPSHOT.jar/io.github.retrooper.packetevents.injector.handlers.PacketEventsEncoder.encode(PacketEventsEncoder.java:52) ~[packetevents-spigot-2.6.1-SNAPSHOT.jar:?]
at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:90) ~[netty-codec-4.1.97.Final.jar:4.1.97.Final]
at packetevents-spigot-2.6.1-SNAPSHOT.jar/io.github.retrooper.packetevents.injector.handlers.PacketEventsEncoder.write(PacketEventsEncoder.java:107) ~[packetevents-spigot-2.6.1-SNAPSHOT.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:881) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:863) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:968) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:856) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:113) ~[netty-codec-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:881) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:863) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:968) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:856) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:113) ~[netty-codec-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:881) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:863) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:968) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:856) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.ChannelOutboundHandlerAdapter.write(ChannelOutboundHandlerAdapter.java:113) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at net.minecraft.network.Connection$2.write(Connection.java:762) ~[paper-1.21.3.jar:1.21.3-DEV-3c9a018]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:881) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:863) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:968) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:856) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.ChannelDuplexHandler.write(ChannelDuplexHandler.java:115) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at ModelEngine-4.0.8.jar/com.ticxo.modelengine.v1_21_R2.network.ModelEngineChannelHandler.write(ModelEngineChannelHandler.java:110) ~[ModelEngine-4.0.8.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:879) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:863) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:968) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:856) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:851) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.DefaultChannelPipeline.write(DefaultChannelPipeline.java:1010) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannel.write(AbstractChannel.java:296) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at net.minecraft.network.Connection.doSendPacket(Connection.java:513) ~[paper-1.21.3.jar:1.21.3-DEV-3c9a018]
at net.minecraft.network.Connection.lambda$sendPacket$13(Connection.java:498) ~[paper-1.21.3.jar:1.21.3-DEV-3c9a018]
at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) ~[netty-common-4.1.97.Final.jar:4.1.97.Final]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167) ~[netty-common-4.1.97.Final.jar:4.1.97.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) ~[netty-common-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:413) ~[netty-transport-classes-epoll-4.1.97.Final.jar:4.1.97.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.97.Final.jar:4.1.97.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.97.Final.jar:4.1.97.Final]
at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]
The entity id one is easy, the async one. Not so much.
This has occurred whenever I disguise a mob, such as a zombie, into a player, unload it, then go back into viewing range for it to be loaded back.