I am making a seasons plugin. In order for it to work, it needs to change the biome types of all the world it is enabled. I found that what I have to use are one of:
SetAreaBiome(MinX, MaxX, MinZ, MaxZ, EMCSBiome)
SetAreaBiome(Cuboid, EMCSBiome)
SetBiomeAt(BlockX, BlockZ, EMCSBiome)
The problem is that I have no idea what parameters should I give it so that it changes the whole generated world...
Could you assist me?
But still, what MinX, MaxX, MinZ, MaxZ should I use so that it covers all the known world?
Those are numbers.
For example:
World:SetAreaBiome(0, 5, 0, 5, biOcean)
Now in the world between the coordinates X0, 5 and Z0, 5 the biomes will change to an ocean biome. They are simply coordinates.
But I don't want to change only the world between (eg) the coordinates X0, 5 and Z0, 5. I want to change ALL the known world
And I am sorry for vexing you...
Then use the OnChunkGenerated hook and set it for each chunk as it is generated.
That doesn't work, you need to set it afterwards. Is there an onchunkloaded hook you could use? That would be easiest. And it would avoid extra strain - only change the biomes when somebody is there to see the change.
HookChunkAvailable looks perfect:
http://mc-server.xoft.cz/LuaAPI/OnChunkAvailable.html
You probably want to change chunks that are loaded already as well, and a cWorld::ForEachChunkLoaded will probably be needed. I don't think a similar function is exported though?
Actually doble checking the best hook is onChunkGenerating. Then you can inject your biome into the generator pipeline, replacing the default biome generator.
Also rereading the post, changing the biome on its own is not enough, as it will only change things like mob spawning. You will also need to trigger chunk regeneration as well. This could be an expensive plugin with the current API.
OnchunkGenerating is useless, he wants to change existing chunks, not new ones.