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

Hello! How generate ore in custom dimension of another mod? (In my case, I'm trying to add generation to the Misty World by @Liahim)

In the generator, in the generate method, I did such checking if

(world.provider.getDimension () == Mist.dimensionID)

 and such if

(world.provider.getDimension () == 69)

Does not work(

 

In general, here is my generator, and I'm trying to add the generation of my ore to a measurement from another mod:

public class MistyThaumcraftWorldGenerator implements IWorldGenerator
{
    private WorldGenerator ore_amber;
  
    public MistyThaumcraftWorldGenerator()
    {
        ore_amber = new WorldGenMinable(RegisterBlocks.ore_amber.getDefaultState(), 9);
    }

    public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider)
    {
        if (world.provider.getDimension() == Mist.dimensionID) {

            runGenerator(ore_amber, world, random, chunkX, chunkZ, 80, 5, 180);     

        }
      
    }
  
    private void runGenerator(WorldGenerator gen, World world, Random rand, int chunkX, int chunkZ, int chance, int minHeight, int maxHeight)
    {
        if(minHeight > maxHeight || minHeight < 0 || maxHeight > 256) throw new IllegalArgumentException("Ore generated out of bounds");
        int heightDiff = maxHeight - minHeight + 1;
      
        for(int i = 0; i < chance; i++)
        {
            int x = chunkX * 8 + rand.nextInt(8);
            int y = minHeight + rand.nextInt(heightDiff);
            int z = chunkZ * 8 + rand.nextInt(8);
          
            gen.generate(world, rand, new BlockPos(x, y, z));
        }
    }
}

 

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.