Closed EtlamGit closed 10 years ago
Yes, I know. And when it comes to bonemeal, there is jack shit I can do about it. Either we completely destroy our bonemeal system in place of hard coding vanilla functionality, or we expand it like we are and keep it sane and reasonable. In 1.7, Mojang severely screwed up when it comes to modding and flowers. There is no clean way to reproduce vanilla behavior on bonemeal generically across all biomes and still have an expandable list like people want.
So basically, I know, and wont fix.
I agree on your points. As in the Plains biome most flowers are placed randomly but some locations based there is no consistent way to represent that behavior modder-friendly.
But for the FlowerForest I could imagine a solution: In BiomeGenBase.java.patch method plantFlower(...) you are currently doing something like: 1) take "flowers" list with possible flowers for the current biome 2) select a random one, evenly distributed (real distribution comes from the list) 3) if after some checks everything look ok, place the flower
As in the FlowerForest ALL flowers are placed location based, a simple if clause (triggered by FlowerForst biome) for step 2) could use a location based random generator instead of the WeightedRandom which will be used for all other biomes. The resulting random value has to be scaled to the number of entries in the "flowers" list, but it should be possible to 100% reproduce vanilla behavior: This leaves the modder-friendly changeable "flowers" list, but allows flowers to be placed in the FlowerForest like in vanilla code. If someone changes the "flowers" list for the FlowerForest, he will get his different flowers, but also location based.
(As I'm using MCP9.03 to just read the code, a code example would not help, but you know the code better anyway...)
I could special case one biome or another, But I won't. As that would be stupid and it would not reflect vanilla behavior so there would be no point. When using bonemeal, the flowers that are generated are random. That's how it is.
In my opinion original Minecraft code spawns flowers in FlowerForest biome based on the location of the block. Current Forge version spawns just randomly. My test was (with 1.7.2 vanilla): standing in a FlowerForest and applying Bone Meal around me, harvesting everything and repeating that for quite a while. The result was that only Allium spawn to my right and only Houstonia to my left. At other places I always got Tulips at others Poppys and so on. With Forge the spawned flowers are just randomly distributed. This behavior would make sense, as in nature flowers are spreading from bulbs or seeds around their original location. I found also someone else reporting about that: http://imgur.com/a/QVNaB
The source code for generating the random part is different for the Flower Forest compared to other biomes, as it includes positional information. Something similar can also be found in the Plains biome code, but I never observed that behavior in a Plains biome. As I do not understand that code completely, I have no idea how to fix that. If someone could explain what the NoiseGeneratorPerlin is doing, I could try to dig deeper.