Jump to content

How does one change the `WorldProvider`?


Thumbz

Recommended Posts

Simply, I want this:  world.provider = myCustomWorldProvider

 

 

 

So, there's tutorials a plenty on creating and registering a WorldGenerator. (

)

 

There's also a really nice one on creating Dimensions and WorldProvider's. (http://wuppy29.blogspot.com/2013/01/modding-146-custom-dimension-part-6.html)

 

But the only thing I can find which would actually allow me to see my WorldProvider in action is a mod that's not 1.8  (http://minecraft.curseforge.com/mc-mods/226188-default-world-generator)

 

It really seems like there should be another way.  Any advice?

Link to comment
Share on other sites

Do you want to change Overworld? It strongly depends on your purpose.

If you only have to change World Generation, Then you should make your own WorldType

 

So... What is your actual purpose?

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Link to comment
Share on other sites

So if what you want to do is just testing some custom terrain generation,

just create a dimension with your chunkprovider, and transfer the player to the dimension.

 

It would be the easiest way for your purpose.

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Link to comment
Share on other sites

Cool.  This mostly works.  The one thing I'm not fond of is generating the overworld first, and then being teleported on login, but I'm running, and that's good enough for me.

 

For those who are looking for the answer

How to create dimensions (http://wuppy29.blogspot.com/2013/01/modding-146-custom-dimension-part-3.html)

How to teleport dimensions (http://www.minecraftforge.net/forum/index.php?topic=18493.0)

How to call event on player login (http://www.minecraftforge.net/forum/index.php?topic=15153.0)

Link to comment
Share on other sites

I changed the chunk provider

It's two sine waves on the x and z axis.  And the nether portal appears whenever you change dimensions, I guess.

 

 

 

-++==========================++-

 

 

 

@Override

public Chunk provideChunk(int x, int z) {

 

ChunkPrimer chunkprimer = new ChunkPrimer();

 

IBlockState grass = Blocks.grass.getDefaultState();

IBlockState dirt = Blocks.dirt.getDefaultState();

IBlockState stone = Blocks.stone.getDefaultState();

IBlockState bedrock = Blocks.bedrock.getDefaultState();

IBlockState state;

 

for(int ix = 0; ix < 16; ++ix)  {

for(int iz = 0; iz < 16; ++iz)  {

int top = getHeight((x*16)+ix, (z*16)+iz);

chunkprimer.setBlockState(ix, top, iz, grass);

 

for(int depth=1; depth < top; ++depth)  {

if(depth < 10) {

state = dirt;  }

else {

state = stone;  }

chunkprimer.setBlockState(ix, top-depth, iz, state);

}

 

chunkprimer.setBlockState(ix, 0, iz, bedrock);

 

} }

 

Chunk chunk = new Chunk(this.m_world, chunkprimer, x, z);

return chunk;

}

 

 

private int getHeight(int x, int z) {

int xOff = (int) (Math.sin(0.1*(x))*7);

int zOff = (int) (Math.sin(0.07*(z))*10);

return xOff + zOff + 40;

}

Link to comment
Share on other sites

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.

Announcements



×
×
  • Create New...

Important Information

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