Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hi, i'm doing a school project regarding terrain generation in minecraft and i'm having some problems.

 

I already managed to generate structures ingame but i also need to override minecraft generation to generate the entire world and i can't figure out how.

I know that i can create a new dimension to generate my world but i really would like to do it in the overworld if possible.

 

How can i achieve that?

 

Thank you. 

You need to create a new world type or overwrite the default and in the new WorldType.class you create you can specify a custom ChunkProviderGenerate - look at the default version that is where the generation is done.

  • Author

Thank you very much it worked.

But now i have another question...

 

I looked into the ChunkProvider and i noticed two methods to generate terrain :

1)

The first one is to create an array of bytes and send it to this method

public Chunk(World world, byte[] ids, byte[] metadata, int chunkX, int chunkZ)

 

Wich doesn't seem too complicated

 

2)

The second is (i think) to generate the terrain data after creating the chunk like this

 

// Generate extended block storage
                for (int y=0; y<16; y++) {
                        chunk.getBlockStorageArray()[y] = new ExtendedBlockStorage(y << 4, true);
                }
                // Generate 16x16 square of grass blocks at y value of 63.
                for (int x=0; x<16; x++) {
                        for (int z=0; z<16; z++) {
                                chunk.getBlockStorageArray()[3].setExtBlockID(x, 15/*y*/, z, Block.grass.blockID);
                        }
                }

 

i don't really understand how it works but it does

 

Which one is the best to use?

Thanks again.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.