OptiFine breaks entity spawning
toErIpNid opened this issue ยท 17 comments
Using the latest version of Terra as of May 7th, 2021. 7:30pm CST.
While seeing if the mod was usable for a world generator, I noticed while flying around in creative mod that no mobs seem to spawn besides one bee from a bee hive. No squids, no cows, no anything. Not even a witch in what seemed to be a witch-hut structure I found, nor any modded mobs such as snakes or birds from Bewitchment. Is this a bug?
I'm experiencing this issue in my singleplayer survival world too. Also using the fabric version of the mod
Same issue on fabric singleplayer.
I just recreated the world and got a few pigs spawning in spawn chunks where there's a lot of grass (savannah in this case).
Also found a mushroom island but there were no cows and no other animals to be seen on the way there.
Only water mobs are spawning regularly.
Same Issue on Paper Server.
Running latest version (Terra-Bukkit 5.3.1) on 1.16.5 paper server, new generated Map.
Passive animals like Cows, chicken and sheep are spawning normal. Hostile mobs like zombie, creeper also.
Only mobs not spawning are in structures like:
- Blazes and witherskeletons in nether fortress
- Pillager in Outpost
- small guardians in watermonuments (elder guardians do spawn)
- witch in witchhut
- Irongolem in Villages (do spawn at villager breeders)
- Ender dragon, enderman and shulker do spawn
probably many more, we haven't explored more at this point.
This is an incompatibility with OptiFine. We will not consider adding compatibility with OptiFine, as it does inexplicable things and is a closed-source mod, making working with it a nightmare.
OptiFine should not be used on Fabric anyways - for alternatives (which will get you even greater performance improvements, and have most of the QOL features OptiFine does), see this Gist: https://gist.github.com/LambdAurora/1f6a4a99af374ce500f250c6b42e8754
I have the same issue as RiftScuttlermidalist. Only squid, fish, dolphins, and hostile mobs are spawning but no passive mobs are spawning on land. I'm running a brand new fabric singleplayer world. I am not running Optifine.
Then open a new issue. This issue was caused by OptiFine, if you're having a similar issue, do more testing to figure out a possible cause and open a new issue.
Also see #139 I posted about this and proposed a fix. I am using the Fabric version though so if you are using the Bukkit version these could be different issues.
I think the issue is due to the fact that Terra doesn't actually copy biome data from the vanilla biomes so all of the biome-specific spawn settings and stuff are lost, it just copies from whatever the first biome happens to be which could very well just be "void" or "plains" or something.
Terra should be copying from alike biomes.
Jungles should copy from jungle data, otherwise ocelots won't spawn.
Plains should copy from plains data for better plains spawn rates.
Snowy biomes should copy from snowy biome data.
Mountain biomes like the craig biomes should copy from extreme hills or something.
This is why pandas and things just won't spawn ever at all, they're biome specific mobs so their spawn data has to be copied and currently the mod doesn't do this.
I don't know why you think we are copying all spawn info from void biomes... look at the code again.
I have consistently been unable to replicate this issue. Parrots and Ocelots spawn in jungles, rabbits spawn in deserts, pandas spawn in bamboo jungles, etc. This was all tested when I closed the previous issue. You probably updated an old world to a new version, in that case be sure to reset your world first.
I don't know why you think we are copying all spawn info from void biomes... look at the code again.
I have consistently been unable to replicate this issue. Parrots and Ocelots spawn in jungles, rabbits spawn in deserts, pandas spawn in bamboo jungles, etc. This was all tested when I closed the previous issue. You probably updated an old world to a new version, in that case be sure to reset your world first.
I apologize then, its good to hear this.
This must have changed since I last looked or I missed it, because, I remember seeing biome data, specifically spawn data getting copied from refToBiomes.get(0)
or something along those lines. It may just be that the actual spawn data copying is done elsewhere from where I was looking as well.
Is there a way old worlds can be manually fixed? E.g. via an NBT editor? We're using this on a Fabric server and doing a world reset is not feasible but if it takes a little to change biome names or something then that's what I'll do.
Also, my issue wasn't closed, its different than the original one I was talking about before.
The issue was caused by heightmap data not being generated. If you really want to, you can make a tool to go through all your currently generated chunks and generate that data. Simply going to ungenerated chunks as well should work, albeit only in those ungenerated chunks.
The issue was caused by heightmap data not being generated. If you really want to, you can make a tool to go through all your currently generated chunks and generate that data. Simply going to ungenerated chunks as well should work, albeit only in those ungenerated chunks.
Our specific issue isn't that mobs aren't spawning at all its that passive mobs are spawning incredibly slow and biome specific mobs didn't seem to be spawning, I think it took almost an hour before anyone found sheep and cows around and the rates of mobs spawning was super slow, it was taking a long time for things to respawn and stuff. Hostile mobs are handled globally iirc and we aren't having any problems with hostile mobs spawning. I don't think it was height map data since I think we generated the world after this fix.
Also, I found the specific line I was thinking of but again I probably missed something:
https://github.com/PolyhedralDev/Terra/tree/master/platforms/fabric/src/main/java/com/dfsek/terra/fabric/TerraFabricPlugin.java#L256
Line 290 is where the spawn settings from the first are applied.
That list does not contain all Vanilla biomes, just the biomes specified in the config. And in the case of the default config, the size of that list is always one. The option accepts a probability collection to allow merging of biome colors, and it takes the first biome in that collection to get spawn information from.
Also see #139 I posted about this and proposed a fix. I am using the Fabric version though so if you are using the Bukkit version these could be different issues.
I think the issue is due to the fact that Terra doesn't actually copy biome data from the vanilla biomes so all of the biome-specific spawn settings and stuff are lost, it just copies from whatever the first biome happens to be which could very well just be "void" or "plains" or something.
Terra should be copying from alike biomes.
Jungles should copy from jungle data, otherwise ocelots won't spawn.
Plains should copy from plains data for better plains spawn rates.
Snowy biomes should copy from snowy biome data.
Mountain biomes like the craig biomes should copy from extreme hills or something.This is why pandas and things just won't spawn ever at all, they're biome specific mobs so their spawn data has to be copied and currently the mod doesn't do this.
I was using the fabric version.
I don't know why you think we are copying all spawn info from void biomes... look at the code again.
I have consistently been unable to replicate this issue. Parrots and Ocelots spawn in jungles, rabbits spawn in deserts, pandas spawn in bamboo jungles, etc. This was all tested when I closed the previous issue. You probably updated an old world to a new version, in that case be sure to reset your world first.
Can confirm I had generated a completely new world during this bug.
That list does not contain all Vanilla biomes, just the biomes specified in the config. And in the case of the default config, the size of that list is always one. The option accepts a probability collection to allow merging of biome colors, and it takes the first biome in that collection to get spawn information from.
Cool. I'm misunderstanding the code then, sorry about that. Thank you.
If I generate a new world with the same seed, I am assuming I would be able to just copy the height map data for each chunk and the issue should be fixed, assuming we did generate the world in an older version?