
Guard Villagers: Error Log Spam
avilonlegends opened this issue ยท 5 comments
Describe the bug
When I used an elytra to fly across my world to test c2me in my modpack, I eventually got a huge, never-ending row of error log spam. The game seemed to work as intended, but the errors do worry me a bit.
Could you perhaps look into this?
Thank you in advance!
Runtime info:
- OS: Windows
- Minecraft version: 1.21.1 Fabric
- Mod version: 0.3.0+alpha.0.320+1.21.1
Crash reports / logs
https://mclo.gs/TjS7OCO (errors start at line 1307)
Checklist
- I am using the official version of the mod.
- I tried the latest development version but the issue persists.
- I searched for similar open issues and could not find an existing bug report on this.
Sorry for taking a while, but I found the root of the problem.
It's the mod 'Guard Villagers'. https://modrinth.com/mod/guard-villagers-(fabricquilt)
To recreate the problem, try the following:
- Create a new world.
- Teleport to the nearest village.
- The errors should fill your console.
(If you spawn near a village, the errors might show up immediately after world creation).
Here is the log of my minimal instance:
https://mclo.gs/wlznzb8
Hope that helps!
(Edit with the log of a completely new minimal instance)
I would say there's some mods doing weird things here. Please find the minimum set of mods reproducible.
I'm not sure why this doesn't crash in vanilla, but it might just be extra lucky.
The problem is that spawning entities during that event callback is almost guaranteed to cause this issue:
https://github.com/mrsterner/GuardVillagers/blob/b67ac7b1edc58c9401e19e304e4341fc1a5f3ccf/src/main/java/dev/sterner/guardvillagers/GuardVillagers.java#L120
The solution is to defer the spawning.
This should be reported to guard villagers.
Problematic call stacktrace
java.lang.Throwable
at net.minecraft.server.world.ServerEntityManager.addEntity(ServerEntityManager.java:103)
at net.minecraft.server.world.ServerEntityManager.addEntity(ServerEntityManager.java:91)
at net.minecraft.server.world.ServerWorld.addEntity(ServerWorld.java:996)
at net.minecraft.server.world.ServerWorld.spawnEntity(ServerWorld.java:946)
at java.base/java.util.stream.Streams$StreamBuilderImpl.forEachRemaining(Streams.java:411)
at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:734)
at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:782)
at net.minecraft.world.ServerWorldAccess.spawnEntityAndPassengers(ServerWorldAccess.java:16)
at dev.sterner.guardvillagers.GuardVillagers.lambda$onInitialize$2(GuardVillagers.java:120)
at net.fabricmc.fabric.api.event.lifecycle.v1.ServerEntityEvents.lambda$static$0(ServerEntityEvents.java:39)
at net.minecraft.server.world.ServerWorld$ServerEntityHandler.handler$bao000$fabric-lifecycle-events-v1$invokeEntityLoadEvent(ServerWorld.java:2085)
at net.minecraft.server.world.ServerWorld$ServerEntityHandler.startTracking(ServerWorld.java:1965)
at net.minecraft.server.world.ServerWorld$ServerEntityHandler.startTracking(ServerWorld.java:1928)
at net.minecraft.server.world.ServerEntityManager.startTracking(ServerEntityManager.java:155)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:194)
at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1939)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:556)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:546)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:611)
at net.minecraft.server.world.ServerEntityManager.method_31825(ServerEntityManager.java:208)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:194)
at java.base/java.util.stream.LongPipeline$1$1.accept(LongPipeline.java:177)
at java.base/java.util.PrimitiveIterator$OfLong.forEachRemaining(PrimitiveIterator.java:185)
at java.base/java.util.Spliterators$LongIteratorSpliterator.forEachRemaining(Spliterators.java:2144)
at java.base/java.util.Spliterator$OfLong.forEachRemaining(Spliterator.java:777)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:556)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:546)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:611)
at net.minecraft.server.world.ServerEntityManager.updateTrackingStatus(ServerEntityManager.java:195)
at net.minecraft.server.world.ServerEntityManager.updateTrackingStatus(ServerEntityManager.java:174)
at net.minecraft.server.world.ServerChunkLoadingManager.onChunkStatusChange(ServerChunkLoadingManager.java:1208)
at net.minecraft.server.world.ServerChunkLoadingManager.invokeOnChunkStatusChange(ServerChunkLoadingManager.java)
at com.ishland.c2me.rewrites.chunksystem.common.TheChunkSystem.lambda$onItemUpgrade$3(TheChunkSystem.java:136)
at net.minecraft.util.thread.ThreadExecutor.executeTask(ThreadExecutor.java:140)
at net.minecraft.server.world.ServerChunkManager$MainThreadExecutor.executeTask(ServerChunkManager.java:567)
at net.minecraft.util.thread.ThreadExecutor.runTask(ThreadExecutor.java:114)
at net.minecraft.server.world.ServerChunkManager$MainThreadExecutor.runTask(ServerChunkManager.java:576)
at net.minecraft.server.MinecraftServer.executeTasksMidTick(MinecraftServer.java:5342)
at net.minecraft.server.world.ServerWorld.handler$zoe000$c2me-opts-scheduling$onPostTickBlockAndFluid(ServerWorld.java:4064)
at net.minecraft.server.world.ServerWorld.tickFluid(ServerWorld.java:781)
at net.minecraft.world.tick.WorldTickScheduler.tick(WorldTickScheduler.java:190)
at net.minecraft.world.tick.WorldTickScheduler.tick(WorldTickScheduler.java:89)
at net.minecraft.server.world.ServerWorld.tick(ServerWorld.java:383)
at net.minecraft.server.MinecraftServer.tickWorlds(MinecraftServer.java:1053)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:952)
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:110)
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:747)
at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:288)
at java.base/java.lang.Thread.run(Thread.java:1570)