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

I'm trying to generate terrain in my custom dimension using noise, but I don't really know how to.

 

When I did plugin development, this was pretty easy (and I also just want simple, hilly terrain):

SimplexOctaveGenerator generator = new SimplexOctaveGenerator(new Random(world.getSeed()), 8);
ChunkData chunk = createChunkData(world);
generator.setScale(0.007D);
		
for (int X = 0; X < 16; X++)
{
  for (int Z = 0; Z < 16; Z++) 
  {
	currentHeight = (int) (generator.noise(chunkX * 16 + X, chunkZ * 16 + Z, 0.5D, 0.5D) * 15D + 50D);
                
    chunk.setBlock(X, currentHeight, Z, Material.GRASS);
    chunk.setBlock(X, currentHeight-1, Z, Material.DIRT);

    for (int i = currentHeight-2; i > 0; i--)
    {
      chunk.setBlock(X, i, Z, Material.STONE);
    }

    chunk.setBlock(X, 0, Z, Material.BEDROCK);
  }
}

but it looks like it isn't that simple with forge.

 

Any help is appreciated

 

Thanks,

MasterComlud

  • Author

So, I tried to import the source code used for noise from bukkit and changed it to fit my mod, but without success.

Can stuff like that even work? xD (probably, if you're experienced, which I'm not)

 

I just need a good and easy way to use noise.

Please help,

MasterComlud

I'm not quite sure what your concern is regarding Bukkit versus Forge. Terrain generation is just a matter of placing blocks, and the "noise" is meant to add natural variety in the choice of where to place the blocks. The math behind the noise generation should be the same (or can be made the same easily).

 

The tricky part with noise though is the "tuning". Just a minor difference in a parameter for the noise generator, or just a minor difference in the threshold for deciding whether a block is placed or not, can make a large practical difference to the world that gets generated.

 

You didn't really explain what you're trying to achieve specifically in terms of the resulting terrain. But you can either start with your plugin code and just make sure the math matches up, or you can start with the Minecraft vanilla generators and see if you can tweak them. You could also try using the custom terrain generator and seeing if you can get what you want and then use those values to hard-code a generator specific for your mod.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

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.