I'm making a custom-requested mod that should stop all grass and flowers from generating naturally.
So far it's simple enough, I just set up a handler for DecorateBiomeEvent.Decorate and set the Result to Result.Deny it if it's EventType.GRASS or EventType.FLOWERS. It works fine for normal grass and flowers.
Problem: Denying the event doesn't stop double-plants from generating (Double Tallgrass and Sunflowers are the most obvious).
Where are these actually generated so I can try to intercept them?
Or should I do it the looooooong way and scan each chunk for double-plants after gen?
Or is there another approach?
Rollback Post to RevisionRollBack
Click this banner for a list of illegal mod distributors -- only download from legal sites!
Okay, now that I'm at my computer and testing it, denying the REED event does not work because four BiomeGenBases override and super BiomeGenBase#decorate to add double plants independently.
Specifically, BiomeGenBase has a WorldGenDoublePlant field that is used in BiomeGenForest, BiomeGenPlains, BiomeGenSavanna, and BiomeGenTaiga. They don't fire any events before adding their own decorations.
Any suggestions?
Rollback Post to RevisionRollBack
Click this banner for a list of illegal mod distributors -- only download from legal sites!
I'm making a custom-requested mod that should stop all grass and flowers from generating naturally.
So far it's simple enough, I just set up a handler for DecorateBiomeEvent.Decorate and set the Result to Result.Deny it if it's EventType.GRASS or EventType.FLOWERS. It works fine for normal grass and flowers.
Problem: Denying the event doesn't stop double-plants from generating (Double Tallgrass and Sunflowers are the most obvious).
Where are these actually generated so I can try to intercept them?
Or should I do it the looooooong way and scan each chunk for double-plants after gen?
Or is there another approach?
Double grass falls under the reed enum
My Mods:
- Happy Coding -
Thanks
Okay, now that I'm at my computer and testing it, denying the REED event does not work because four BiomeGenBases override and super BiomeGenBase#decorate to add double plants independently.
Specifically, BiomeGenBase has a WorldGenDoublePlant field that is used in BiomeGenForest, BiomeGenPlains, BiomeGenSavanna, and BiomeGenTaiga. They don't fire any events before adding their own decorations.
Any suggestions?
Nevermind, it has been solved. I found this old post and realized I could replace vanilla biomes with identical (but double-plant-free) versions.
Actually doing it was easier than I expected, too.