mactso / HarderFishesAndAmphibians

MIT License
0 stars 0 forks source link

IllegalArgumentException from WeightedRandom #4

Open No3371 opened 3 years ago

No3371 commented 3 years ago

I have a really huge modpack and recently this happened out of no where:

[07Jan2021 21:38:13.448] [Server thread/ERROR] [net.minecraft.server.MinecraftServer/]: Encountered an unexpected exception
net.minecraft.crash.ReportedException: Exception ticking world
    at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:854) ~[?:?]
    at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:291) ~[?:?]
    at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:786) ~[?:?]
    at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:641) ~[?:?]
    at net.minecraft.server.MinecraftServer.lambda$startServer$0(MinecraftServer.java:232) ~[?:?]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_272]
Caused by: java.lang.IllegalArgumentException
    at net.minecraft.util.WeightedRandom.func_76273_a(SourceFile:20) ~[?:?]
    at net.minecraft.util.WeightedRandom.func_76271_a(SourceFile:39) ~[?:?]
    at net.minecraft.world.spawner.WorldEntitySpawner.func_234977_a_(WorldEntitySpawner.java:259) ~[?:?]
    at net.minecraft.world.spawner.WorldEntitySpawner.func_234966_a_(WorldEntitySpawner.java:157) ~[?:?]
    at net.minecraft.world.spawner.WorldEntitySpawner.func_234967_a_(WorldEntitySpawner.java:124) ~[?:?]
    at net.minecraft.world.spawner.WorldEntitySpawner.func_234979_a_(WorldEntitySpawner.java:110) ~[?:?]
    at net.minecraft.world.server.ServerChunkProvider.func_241099_a_(SourceFile:388) ~[?:?]
    at java.util.ArrayList.forEach(ArrayList.java:1259) ~[?:1.8.0_272]
    at net.minecraft.world.server.ServerChunkProvider.func_217220_m(SourceFile:368) ~[?:?]
    at net.minecraft.world.server.ServerChunkProvider.func_217207_a(SourceFile:337) ~[?:?]
    at net.minecraft.world.server.ServerWorld.func_72835_b(ServerWorld.java:333) ~[?:?]
    at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:850) ~[?:?]
    ... 5 more

After done some research this is caused by wrong weight calculation when picking mob to spawn from a biome's mob candidates. So I did some A/B test with mob mods and it turns out It's Hostile Water Monster.

This is weird because It has been days since I got the mod, and It had been running OK (except for the noise/console spams). As the exception always happens when any player arrive a certain area in my world, I deduced it's one of the biome somehow has a corrupted weight table when Hostile Water Monster is loaded.

As Minecraft just don't give any useful info when stuff spawning goes wrong, unfortunately the only related information I have for you is I have BYG (Oh The Biomes You Go) installed and I've triple checked all the config values are good. Also I can not isolate the potential problematic biome because it will instant crash as soon as anyone get close to the area.

So this is a FYI/reminder to let you know this happended so if anyone else also encountered this It's not so surprising.

mactso commented 3 years ago

We use BYG as well and hadn't had a problem so far but minecraft modding is like that isn't it?

Please provide a worldseed, minecraft version, and the x,y,z coordinates. Pending this info, I'll load HWM with BYG and give it a look to see if I can generate a crash..

I just finished a major upgrade with a rewrite of the spawn weight functions and uploaded a new version for 1.16.3, 1.16.4, and 1.16.5.

You are the first report of this problem. However, it could explode into a big deal any time so always best to try to stay ahead of these things.

Note: check for double spawner entries. check for null spawner entries.

mactso commented 3 years ago

I may have fixed this. I think it occurred when a biome had no existing spawns defined for it. Would appreciate your worldseed so I can look at it personally!

No3371 commented 3 years ago

Sorry for the silence, got busy. Just quickly took a look in the level.dat: 6513664960513486835, hope it helps. (Unfortunately we did not note the coordinates.

mactso commented 3 years ago

No Problem! We all do. I'll give this a look.