Matter Overdrive: Community Edition

Matter Overdrive: Community Edition

134k Downloads

Crash: Attempted to set villager profession to unregistered profession: 6 null

TheNumenorean opened this issue ยท 5 comments

commented

Describe the bug
When exploring, happening upon a new village sometimes crashes the server with:

04.05 10:49:27 [Server] Server thread/ERROR [minecraft/MinecraftServer]: Encountered an unexpected exception
04.05 10:49:27 [Server] INFO java.lang.RuntimeException: Attempted to set villager profession to unregistered profession: 6 null
04.05 10:49:27 [Server] INFO at net.minecraftforge.fml.common.registry.VillagerRegistry.onSetProfession(VillagerRegistry.java:332) ~[VillagerRegistry.class:?]
04.05 10:49:27 [Server] INFO at net.minecraft.entity.passive.EntityVillager.notifyDataManagerChange(EntityVillager.java:457) ~[ady.class:?]
04.05 10:49:27 [Server] INFO at net.minecraft.network.datasync.EntityDataManager.set(EntityDataManager.java:160) ~[nb.class:?]
04.05 10:49:27 [Server] INFO at net.minecraft.entity.passive.EntityVillager.setProfession(EntityVillager.java:423) ~[ady.class:?]
04.05 10:49:27 [Server] INFO at net.minecraft.world.gen.structure.StructureVillagePieces$Village.redirect$onSetProfessionViaStructureSpawn$zzl000(StructureVillagePieces.java:2015) ~[bcb$n.class:?]
04.05 10:49:27 [Server] INFO at net.minecraft.world.gen.structure.StructureVillagePieces$Village.spawnVillagers(StructureVillagePieces.java:1792) ~[bcb$n.class:?]
04.05 10:49:27 [Server] INFO at net.minecraft.world.gen.structure.StructureVillagePieces$WoodHut.addComponentParts(StructureVillagePieces.java:2137) ~[bcb$h.class:?]
04.05 10:49:27 [Server] INFO at net.minecraft.world.gen.structure.StructureStart.generateStructure(StructureStart.java:47) ~[bby.class:?]
04.05 10:49:27 [Server] INFO at net.minecraft.world.gen.structure.MapGenStructure.generateStructure(MapGenStructure.java:94) ~[bbu.class:?]
04.05 10:49:27 [Server] INFO at ivorius.reccomplex.world.gen.feature.structure.MapGenStructureHook.generateStructure(MapGenStructureHook.java:96) ~[MapGenStructureHook.class:?]
04.05 10:49:27 [Server] INFO at ivorius.reccomplex.events.handlers.RCTerrainGenEventHandler$3.generateStructure(RCTerrainGenEventHandler.java:220) ~[RCTerrainGenEventHandler$3.class:?]
04.05 10:49:27 [Server] INFO at net.minecraft.world.gen.ChunkGeneratorOverworld.populate(ChunkGeneratorOverworld.java:406) ~[aze.class:?]
04.05 10:49:27 [Server] INFO at net.minecraft.world.chunk.Chunk.populate(Chunk.java:1019) ~[axw.class:?]
04.05 10:49:27 [Server] INFO at net.minecraft.world.chunk.Chunk.populate(Chunk.java:980) ~[axw.class:?]
04.05 10:49:27 [Server] INFO at net.minecraftforge.common.chunkio.ChunkIOProvider.syncCallback(ChunkIOProvider.java:110) ~[ChunkIOProvider.class:?]
04.05 10:49:27 [Server] INFO at net.minecraftforge.common.chunkio.ChunkIOExecutor.tick(ChunkIOExecutor.java:150) ~[ChunkIOExecutor.class:?]
04.05 10:49:27 [Server] INFO at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:728) ~[MinecraftServer.class:?]
04.05 10:49:27 [Server] INFO at net.minecraft.server.dedicated.DedicatedServer.updateTimeLightAndEntities(DedicatedServer.java:397) ~[nz.class:?]
04.05 10:49:27 [Server] INFO at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:668) ~[MinecraftServer.class:?]
04.05 10:49:27 [Server] INFO at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526) [MinecraftServer.class:?]
04.05 10:49:27 [Server] INFO at java.lang.Thread.run(Thread.java:748) [?:1.8.0_311]

I have poured over the code for hours trying to fix this myself, with no luck. I had the same error in the legacy edition, and had hoped moving to community would fix it.

It is very hard to intentionally replicate, i havent been able to in the dev environment yet.

I am loosing my mind.

To Reproduce
Steps to reproduce the behavior:

  1. Travel in-world until happening upon a village.
  2. If the village tries to spawn a mad scientist house, then:
  3. Client exits with "server closed" and server crashes with above error message.
  4. Restart server
  5. Log in with client
  6. Sometimes error is gone, and can carry on as normal. Sometimes repeat from step 3.

Expected behavior
No crashing.

please complete the following information:

  • Forge Version: 1.12.2-2847
  • Mods [e.g. mekanism, optifine]: In attached crash report
  • MO Version [e.g. 0.7.4]: 0.7.9

Additional context
crash-2022-05-04_15.49.27-server.txt

commented

that points to recurrentcomplex
04.05 10:49:27 [Server] INFO at ivorius.reccomplex.world.gen.feature.structure.MapGenStructureHook.generateStructure(MapGenStructureHook.java:96) ~[MapGenStructureHook.class:?]
04.05 10:49:27 [Server] INFO at ivorius.reccomplex.events.handlers.RCTerrainGenEventHandler$3.generateStructure(RCTerrainGenEventHandler.java:220) ~[RCTerrainGenEventHandler$3.class:?]

commented

So yes, but I think reccomp injects itself during all village generation so that it can control things, so i am not surprised by that. At one point i found that the id "6" linked to the MO mad scientist profession, but i dont remember how i did that.

Of course, entirely possible this isn't related to MO. Maybe ill see if i can add some extra debugging statements and get more data, but any ideas would be great.

commented

Oh also, mad scientist houses that i do find in the world never have a mad scientist in them, only the inscriber and the crate with a data pad and a contract.

commented

After messing around for a while longer and finding WildBamaBoy/minecraft-comes-alive#888, i opened up the level.dat and found that there was no mapping for profession id 6. I swapped the id of the highest numbered existing profession to 6, and that seems to have fixed it.

I dont know why this happened, maybe it was because of the old version of MO when i saw the earlier mapping of 6 -> madScientist, but regardless it seems fine now. Sorry for the errant report.

commented

good to know, no problem we have had weird issues pop up via updating.