Easy NPC

Easy NPC

2M Downloads

Distance Actions Bug Crashes Server 1.20.1

Shehr2424 opened this issue ยท 7 comments

commented

Hello! I ran into this issue on my server where if you create an action for walking within a certain distance to the NPC (ex. at 4 blocks away the NPC is given the action: /say hello) and more than one players walk within that distance it will crash the entire server. So far we have only seen this issue happening with the distance actions, other actions work fine with multiple players. I didn't see any other reports of this so wanted to put it out there!

commented

Thanks for the report. Could you please share the corresponding crash-log with me so that I know were I need to look to fix the issue ?
The distance actions are using a re-trigger protection so a crash logs helps to isolate the issue. Thanks.

commented

_Edit:_Here is a link that shows the crash-log that might be easier to read https://paste.shockbyte.com/ucoxelecotuhoruluboq
Gotcha, here is the most recent log:
08.11 00:52:03 [Server] Server thread/INFO [minecraft/MinecraftServer]: [Not Secure] [John John] test 08.11 00:52:04 [Server] Server thread/INFO [minecraft/MinecraftServer]: There are 2 of a max of 120 players online: tai676, CatCorp 08.11 00:52:21 [Server] Server thread/INFO [minecraft/MinecraftServer]: [CatCorp: Teleported tai676 to CatCorp] 08.11 00:52:28 [Server] Server thread/INFO [minecraft/MinecraftServer]: [Not Secure] [John John] test 08.11 00:52:38 [Server] Server thread/INFO [minecraft/MinecraftServer]: [Not Secure] [John John] test 08.11 00:52:39 [Server] Server thread/ERROR [minecraft/MinecraftServer]: Encountered an unexpected exception 08.11 00:52:39 [Server] INFO net.minecraft.ReportedException: Ticking entity 08.11 00:52:39 [Server] INFO at net.minecraft.server.MinecraftServer.m_5703_(MinecraftServer.java:897) ~[server-1.20.1-20230612.114412-srg.jar%23147!/:?] {re:mixin,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:citadel.mixins.json:MinecraftServerMixin,pl:mixin:A} 08.11 00:52:39 [Server] INFO at net.minecraft.server.dedicated.DedicatedServer.m_5703_(DedicatedServer.java:283) ~[server-1.20.1-20230612.114412-srg.jar%23147!/:?] {re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B} 08.11 00:52:39 [Server] INFO at net.minecraft.server.MinecraftServer.m_5705_(MinecraftServer.java:814) ~[server-1.20.1-20230612.114412-srg.jar%23147!/:?] {re:mixin,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:citadel.mixins.json:MinecraftServerMixin,pl:mixin:A} 08.11 00:52:39 [Server] INFO at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:661) ~[server-1.20.1-20230612.114412-srg.jar%23147!/:?] {re:mixin,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:citadel.mixins.json:MinecraftServerMixin,pl:mixin:A} 08.11 00:52:39 [Server] INFO at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:251) ~[server-1.20.1-20230612.114412-srg.jar%23147!/:?] {re:mixin,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:citadel.mixins.json:MinecraftServerMixin,pl:mixin:A} 08.11 00:52:39 [Server] INFO at java.lang.Thread.run(Thread.java:833) ~[?:?] {} 08.11 00:52:39 [Server] INFO Caused by: java.lang.ClassCastException: class net.minecraft.server.level.ServerPlayer cannot be cast to class java.lang.Comparable (net.minecraft.server.level.ServerPlayer is in module [email protected] of loader 'TRANSFORMER' @58b91d57; java.lang.Comparable is in module java.base of loader 'bootstrap') 08.11 00:52:39 [Server] INFO at java.util.Comparators$NaturalOrderComparator.compare(Comparators.java:47) ~[?:?] {} 08.11 00:52:39 [Server] INFO at java.util.TimSort.countRunAndMakeAscending(TimSort.java:355) ~[?:?] {} 08.11 00:52:39 [Server] INFO at java.util.TimSort.sort(TimSort.java:220) ~[?:?] {} 08.11 00:52:39 [Server] INFO at java.util.Arrays.sort(Arrays.java:1307) ~[?:?] {} 08.11 00:52:39 [Server] INFO at java.util.ArrayList.sort(ArrayList.java:1721) ~[?:?] {re:mixin} 08.11 00:52:39 [Server] INFO at java.util.stream.SortedOps$RefSortingSink.end(SortedOps.java:392) ~[?:?] {} 08.11 00:52:39 [Server] INFO at java.util.stream.Sink$ChainedReference.end(Sink.java:258) ~[?:?] {} 08.11 00:52:39 [Server] INFO at java.util.stream.Sink$ChainedReference.end(Sink.java:258) ~[?:?] {} 08.11 00:52:39 [Server] INFO at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:510) ~[?:?] {} 08.11 00:52:39 [Server] INFO at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?] {} 08.11 00:52:39 [Server] INFO at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) ~[?:?] {} 08.11 00:52:39 [Server] INFO at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?] {} 08.11 00:52:39 [Server] INFO at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682) ~[?:?] {} 08.11 00:52:39 [Server] INFO at de.markusbordihn.easynpc.entity.EasyNPCEntityData.getPlayersInRange(EasyNPCEntityData.java:325) ~[easy_npc_1.20.1-2.0.0.jar%23129!/:2.0.0] {re:classloading} 08.11 00:52:39 [Server] INFO at de.markusbordihn.easynpc.entity.EasyNPCEntity.checkDistanceActions(EasyNPCEntity.java:186) ~[easy_npc_1.20.1-2.0.0.jar%23129!/:2.0.0] {re:classloading} 08.11 00:52:39 [Server] INFO at de.markusbordihn.easynpc.entity.EasyNPCEntity.npcBaseTick(EasyNPCEntity.java:115) ~[easy_npc_1.20.1-2.0.0.jar%23129!/:2.0.0] {re:classloading} 08.11 00:52:39 [Server] INFO at de.markusbordihn.easynpc.entity.EasyNPCEntity.m_6075_(EasyNPCEntity.java:240) ~[easy_npc_1.20.1-2.0.0.jar%23129!/:2.0.0] {re:classloading} 08.11 00:52:39 [Server] INFO at net.minecraft.world.entity.Entity.m_8119_(Entity.java:422) ~[server-1.20.1-20230612.114412-srg.jar%23147!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:create.mixins.json:EntityMixin,pl:mixin:APP:supplementaries-common.mixins.json:EntityMixin,pl:mixin:APP:create.mixins.json:ContraptionDriverInteractMixin,pl:mixin:APP:create.mixins.json:accessor.EntityAccessor,pl:mixin:A} 08.11 00:52:39 [Server] INFO at net.minecraft.world.entity.LivingEntity.m_8119_(LivingEntity.java:2259) ~[server-1.20.1-20230612.114412-srg.jar%23147!/:?] {re:mixin,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:A} 08.11 00:52:39 [Server] INFO at net.minecraft.world.entity.Mob.m_8119_(Mob.java:337) ~[server-1.20.1-20230612.114412-srg.jar%23147!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:moonlight-common.mixins.json:EntityMixin,pl:mixin:A} 08.11 00:52:39 [Server] INFO at net.minecraft.server.level.ServerLevel.m_8647_(ServerLevel.java:693) ~[server-1.20.1-20230612.114412-srg.jar%23147!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:citadel.mixins.json:ServerLevelMixin,pl:mixin:APP:supplementaries-common.mixins.json:ServerLevelMixin,pl:mixin:APP:create.mixins.json:accessor.ServerLevelAccessor,pl:mixin:A} 08.11 00:52:39 [Server] INFO at net.minecraft.world.level.Level.m_46653_(Level.java:479) ~[server-1.20.1-20230612.114412-srg.jar%23147!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:citadel.mixins.json:LevelMixin,pl:mixin:A} 08.11 00:52:39 [Server] INFO at net.minecraft.server.level.ServerLevel.m_184063_(ServerLevel.java:343) ~[server-1.20.1-20230612.114412-srg.jar%23147!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:citadel.mixins.json:ServerLevelMixin,pl:mixin:APP:supplementaries-common.mixins.json:ServerLevelMixin,pl:mixin:APP:create.mixins.json:accessor.ServerLevelAccessor,pl:mixin:A} 08.11 00:52:39 [Server] INFO at net.minecraft.world.level.entity.EntityTickList.m_156910_(EntityTickList.java:54) ~[server-1.20.1-20230612.114412-srg.jar%23147!/:?] {re:classloading} 08.11 00:52:39 [Server] INFO at net.minecraft.server.level.ServerLevel.m_8793_(ServerLevel.java:323) ~[server-1.20.1-20230612.114412-srg.jar%23147!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:citadel.mixins.json:ServerLevelMixin,pl:mixin:APP:supplementaries-common.mixins.json:ServerLevelMixin,pl:mixin:APP:create.mixins.json:accessor.ServerLevelAccessor,pl:mixin:A} 08.11 00:52:39 [Server] INFO at net.minecraft.server.MinecraftServer.m_5703_(MinecraftServer.java:893) ~[server-1.20.1-20230612.114412-srg.jar%23147!/:?] {re:mixin,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:citadel.mixins.json:MinecraftServerMixin,pl:mixin:A} 08.11 00:52:39 [Server] INFO ... 5 more 08.11 00:52:39 [Server] Server thread/FATAL [ne.mi.co.ForgeMod/]: Preparing crash report with UUID 537cf0d6-6f76-4b81-9861-3a3556d0f943 08.11 00:52:39 [Server] Server thread/ERROR [minecraft/MinecraftServer]: This crash report has been saved to: /./crash-reports/crash-2023-11-08_00.52.39-server.txt 08.11 00:52:39 [Server] Server thread/INFO [minecraft/MinecraftServer]: Stopping server 08.11 00:52:39 [Server] Server thread/INFO [minecraft/MinecraftServer]: Saving players 08.11 00:52:39 [Disconnect] User [minecraft/ServerGamePacketListenerImpl]: tai676 has disconnected, reason: Server closed 08.11 00:52:39 [Server] Server thread/INFO [minecraft/MinecraftServer]: tai676 left the game 08.11 00:52:39 [Server] Server thread/INFO [minecraft/MinecraftServer]: Saving worlds 08.11 00:52:40 [Server] Server thread/INFO [minecraft/MinecraftServer]: Saving chunks for level 'ServerLevel[world]'/minecraft:overworld 08.11 00:52:40 [Server] Server thread/INFO [minecraft/MinecraftServer]: Saving chunks for level 'ServerLevel[world]'/minecraft:the_end 08.11 00:52:40 [Server] Server thread/INFO [minecraft/MinecraftServer]: Saving chunks for level 'ServerLevel[world]'/minecraft:the_nether 08.11 00:52:40 [Server] Server thread/INFO [minecraft/MinecraftServer]: ThreadedAnvilChunkStorage (world): All chunks are saved 08.11 00:52:40 [Server] Server thread/INFO [minecraft/MinecraftServer]: ThreadedAnvilChunkStorage (DIM1): All chunks are saved 08.11 00:52:40 [Server] Server thread/INFO [minecraft/MinecraftServer]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved 08.11 00:52:40 [Server] Server thread/INFO [minecraft/MinecraftServer]: ThreadedAnvilChunkStorage: All dimensions are saved 08.11 00:52:41 [Multicraft] Server shut down (running) 08.11 00:52:41 [Multicraft] Restarting crashed server in 10 seconds 08.11 00:52:41 [Multicraft] Server stopped

commented

Thanks a lot for the crash log, this helps a lot.

The problem is that I try to sort the list of near players which failed in your specific case.
So as long there is only one user in the same range this is not causing any issues because there is nothing to sort.
But as soon more than 1 users are in the same rage category the sort() fails.

I will remove the .sort() part and provide an updated versions in the next few hours.

commented

This should be fixed with version 2.0.1, please let me know in the case you still experience any crashes with the fixed version. Thanks.

commented

Awesome! Do you mind if I ask when you think you will be releasing version 2.0.1 for 1.20.1? I saw your 2.0.1 release for 1.19.3 on curseforge but our server is on a different version and cannot use it.

commented

It's already released, but because of their new malware scanner the other versions needs a "manual review" which could take some time. :(

image

commented

Oooh gotcha, all good! As soon as I see it come out I'll test it and let you know if it works!