Change Biome Type
#1
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?
Reply
Thanks given by:
#2
EMCSBiome are the global constants for biomes. For example biBeach is a beach, biDesert is a desert etc.
Example:
SetAreaBiome(MinX, MaxX, MinZ, MaxZ, biBeach)
Full List: http://mc-server.xoft.cz/LuaAPI/Globals.html#BiomeTypes

An explenation for Cuboid is here: http://mc-server.xoft.cz/LuaAPI/cCuboid.html
Reply
Thanks given by:
#3
But still, what MinX, MaxX, MinZ, MaxZ should I use so that it covers all the known world?
Reply
Thanks given by:
#4
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.
Reply
Thanks given by:
#5
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...
Reply
Thanks given by:
#6
Then use the OnChunkGenerated hook and set it for each chunk as it is generated.
Reply
Thanks given by:
#7
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
Reply
Thanks given by:
#8
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?
Reply
Thanks given by:
#9
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.
Reply
Thanks given by:
#10
OnchunkGenerating is useless, he wants to change existing chunks, not new ones.
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)