Jump to content

"Repopulate" already generated Chunks


pupu

Recommended Posts

Hello everyone.

Im stuck in the following problem (some of you might now this?):

i added some new mods to my already "well civilized" world.

the mods added some ores. now they only spawn in newly generated chunks -> bad (more or less).

so i thought to let the existing chunks in the overworld "repopulate".

There is a simple function in the ChunkProvider, named "populate", which should by its description "Populate chunk with ores etc etc".

Well! So this should be done very quick i thought.

Did a tiny mod with a serverside proxy, added a function to it which is called through @ServerStarted. The method runs through, gives me my debugging FMLLog output... but nothing changes.

Has anybody done this before or is able to give me some helping code (i wasnt able to find out, which chunks are already generated and which not)?

Here is what my function looks like (currently):

public void started()
{
	WorldServer wld = DimensionManager.getWorlds()[0];
	int wdim = wld.getWorldInfo().getDimension();
	String wname = wld.getWorldInfo().getWorldName();
	FMLLog.info("started %s (%d)", wname, wdim);
	IChunkProvider cp = wld.getChunkProvider();
	for (int x = -10; x <= 10;x++)
	{
		for (int y = -10;y <= 10;y++)
		{
			Chunk ch = cp.loadChunk(x, y);
			ch.isTerrainPopulated = false;
			cp.populate(cp, x, y);
			FMLLog.info("Pop %d %d (%d %d)", x, y, ch.getChunkCoordIntPair().getCenterXPos(),ch.getChunkCoordIntPair().getCenterZPosition());

		}
	}
	FMLLog.info("finished");
}

Link to comment
Share on other sites

The simple answer would be there is a reason both vanilla minecraft and mods don't already do this.

Consider the following: you install Redpower. "Ohai base let me completely destroy you and generate a volcano in your location :D".

Just generating ores might not have such a direct effect, but could still do some unexpected things. For instance triggering huge sand collapses or again stuff like redpower's marble generation will change your world quite a bit.

 

You are still free to try of course, just note that it might end up destroying your world a bit.

Link to comment
Share on other sites

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.