Greetings,
I am trying to make a mod that randomly generates biomes. My end goal is to call upon a method to generate a biome. Part of my code is this random number generator that generates the color of the grass.
static class BiomeGenCustom extends Biome {
public RandomBiome() {
int Color = myRandomBiome.randomColor();
@SideOnly(Side.CLIENT)
public int getGrassColorAtPos(BlockPos pos) {
return -Color;
}
}
The issue I've encountered is that myBiome's grass color is generated when Minecraft is launched. Consequently, myBiome's grass color will be re-generated (and changed) every time Minecraft is launched.
What I would like to happen is for myBiome's grass color to be generated when the world is made, and stay the same thenceforth.
My current idea entails saving myBiome's grass color to myBiome.txt, and referencing that stored number on world load. I, however, have no clue as to how I would approach implementing this idea.
If you have any questions, let me know.
Thanks,
- Riley
(I am using 1.12.2)