maruohon / paintedbiomes

A Minecraft mod which allocates the biomes based on image templates.
GNU General Public License v3.0
13 stars 3 forks source link

Server crashes when vanilla biome Cold Beach is painted #11

Open Crowfooted opened 5 years ago

Crowfooted commented 5 years ago

Took a lot of trial and error to figure out which biome was causing this crash, but I finally narrowed it down to the vanilla biome "minecraft:cold_beach". Very weird! Not sure if a mod conflict, not super major, but thought I'd make note of it.

https://pastebin.com/e8tEPQxd

maruohon commented 5 years ago

Hmm, somehow the world gen mob spawning has some invalid arguments. I don't even see Painted Biomes in the stack trace, so I doubt it should be anything to do with this mod... Does this happen in every world where you use that biome? Does it happen in a world without Painted Biomes, if you just go to a location where that biome occurs naturally (for example with the help of Amidst)?

Crowfooted commented 5 years ago

It does not happen without Painted Biomes. I have encountered the biome just fine without it in the past - it's a pretty common biome.

It's something to do with beaches in general. So far, I have been able to reproduce the crash using vanilla Cold Beach, vanilla Stone Beach, and BOP White Beach. It does not occur with the normal Beach.

Not sure if it's helpful, but on one occasion only, the crash log mentioned cave generation from Oh The Biomes You'll Go, but I tried removing it, and it still crashed, just without mentioning the name.

Are you sure it's mob spawn related or could it be something else? Should I attempt to load it with doMobSpawning false, to see if it still crashes?

maruohon commented 5 years ago

Well in the crash log you linked, it crashes while trying to pick some random item from a list while doing world gen entity spawning. And the world gen entity spawning doesn't care about the gamerule, so that shouldn't affect it even if you disable that rule. I didn't look in the code yet to see what exactly it does in that method, and what the exact issue there might be.

Does this crash happen with just Painted Biomes alone, if you use those beach biomes?

Crowfooted commented 5 years ago

I haven't tested that yet but I will later.

Crowfooted commented 5 years ago

No, it doesn't, but I'm struggling to pinpoint what interaction is causing it.

Crowfooted commented 5 years ago

Sorry to spam but I am beginning to test different mod combinations to try to pinpoint the problem and I'm having very weird results.

One crash log mentioned a cave generator, so I removed my custom cave generator mod. The crash still occurred, but this time, it mentioned the mod Bewitchment, and a resource from that mod (which only generates on beaches).

So I removed Bewitchment. But, same crash, except no mention of Bewitchment.

I don't have the modding knowhow to have any idea what this means. But it seems from my novice understanding as if some aspect of the way beaches are being generated by PaintedBiomes causes other mods' worldgen to fail when they attempt to generate on or through beaches.

Can you think of any reason why this might be? What kinds of interactions happen on beaches that don't happen on other biomes? I'm just spitballing.

maruohon commented 5 years ago

Okay so looking at the code for the crash log you posted, it seems that the crash, at least in that case, happens because the biome returns a non-empty spawnable creature list that has a total spawning weight of 0. In vanilla the beach biomes, as well as the Ocean and River biomes, simply have a totally empty spawnable creature (animal) list, so the world gen spawning code doesn't run at all. But in your case there must be something on the list, but still with a total weight of 0 for some reason.

Could you run the /tellme dump biomes-with-mob-spawns command from the latest beta version of the TellMe mod, and pastebin the result.

Crowfooted commented 5 years ago

Oh my goodness.

So through some trial and error I was able to find the mod that was causing the problem. Your layman's description of the crash was actually very helpful for this.

I added/removed mods until I found out the problem mod was Animania, and then I remembered that a short while ago I had enabled rodents in that mod, but I did not want hamsters, so I had reduced their spawn weight to zero. (There was an "enable rodents" boolean config, but that config covered both hamsters and ferrets, but I wanted only ferrets.) Lo and behold, the allowed biomes for hamsters to spawn in, included "BEACH".

Removed BEACH from hamster spawn locations, and server boots up smoothly.

I will report this to the Animania dev but I'm not an expert so I will link this issue.

Edit: Still puzzling why this only happens with certain beaches. Normal beaches work just fine and the other beaches also work fine when not used with PaintedBiomes. Very weird.

maruohon commented 5 years ago

Hmm that does sound kinda weird. But there is also one more detail to this: only the block in the very corner (smallest coordinates) of a chunk matters for this. The Chunk population uses the biome from that corner block for the world gen spawning. So it may be that at least in some cases that very corner block happens to be another biome, as the beaches I believe are somewhat narrow usually.

You could still take a look at that TellMe output to see the spawn lists and the weights on those lists for all the biomes, to see if there are other potential troublemakers.

But unless the cause for the "more frequent crashes" with Painted Biomes is the chunk corner block biome, then I don't have any idea what difference using PB would make, as it literally just sets the biome ID for each x/z column, nothing else.

Crowfooted commented 5 years ago

I doubt that is the problem because the way I have been testing it is by creating a world that consists of ONLY beach. This way the server will crash on start, while it's loading the spawn area. Made the trial and error process a lot quicker. So the corner block would have been beach too.

maruohon commented 5 years ago

That's kind of my point, ie. why a normal non-PB world might not immediately crash even if you find those beach biomes naturally in a normal world, because there the corner block might be another biome.

Crowfooted commented 5 years ago

I see what you mean but when I originally encountered the crash, it was not in an all-beach biome, it was on a map with narrow beaches where you would normally expect to find beaches (between 5-20 blocks thick, it didn't seem to matter).

Thankfully it seems to be a simple enough fix, in this case.