Jump to content

Recommended Posts

Posted

Could some one help me i trying to get more than one ore spawn in my custom dimension I have followed a tutorial on multiple ore generation (new to modding) xD but it does not generate right http://oi60.tinypic.com/x22jjp.jpg ignore all the random block just testing things ^^ but as you can see in the picture it spawning them all together and in the same veins of ore. can any one help me fix this please

Code

 

  Reveal hidden contents

 

 

also I have tried copying and pasting the whole loop and changing the xCoord yCoord zCoord to  xCoord1 yCoord1 zCoord1 and so on but it stops generating any chunks.

 

Thanks

Posted

Hey, I remember being in the same place you are! except I didn't have my own dimension. I'm sure you can figure out how to convert this to work in your own dimension though.

This is the code I used:

package ryansmod;

import java.util.Random;

import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import net.minecraft.world.World;
import cpw.mods.fml.common.IWorldGenerator;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import ryansmod.common.block.AleniumOre;
import ryansmod.RyansMod;

public class Generator implements IWorldGenerator {
public static Block AleniumOreGen = new ryansmod.common.block.AleniumOre();
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
        switch(world.provider.dimensionId){
        case -1:
            generateNether(world, random, chunkX * 16, chunkZ * 16);
            break;
        case 0:
            generateSurface(world, random, chunkX * 16, chunkZ * 16);
            break;
        case 1:
            generateEnd(world, random, chunkX * 16, chunkZ * 16);
            break;
        }

}

private void generateEnd(World world, Random random, int i, int j) {}

private void generateSurface(World world, Random random, int i, int j) {
                // Just copy the stuff below to spawn multiple kinds of ores. I hope its not to hard for you to read!
	//Number of clusters of the ore in question spawned
	for(int k = 0; k < 10; k++) {
		int AleniumOreXCoord = i + random.nextInt(16); //remember +i
		int AleniumOreYCoord = random.nextInt(14);
		int AleniumOreZCoord = j + random.nextInt(16); //remember +j
		//WordlGenMinable([block], [Number of block per cluster(?)])
		(new WorldGenMinable(RyansMod.aleniumOre, 5)).generate(world, random, AleniumOreXCoord, AleniumOreYCoord, AleniumOreZCoord);
	}
}

private void generateNether(World world, Random random, int i, int j) {}
}

 

And then in my main file I had it registered with:

 

    @EventHandler
    public void load(FMLInitializationEvent event) {
    		GameRegistry.registerWorldGenerator(new Generator(), 0); 
            proxy.registerRenderers();
    }

 

Hope this helps! Good luck on your mod!

Posted
  On 8/16/2014 at 4:15 AM, himan54 said:

Hey, I remember being in the same place you are! except I didn't have my own dimension. I'm sure you can figure out how to convert this to work in your own dimension though.

This is the code I used:

package ryansmod;

import java.util.Random;

import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import net.minecraft.world.World;
import cpw.mods.fml.common.IWorldGenerator;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import ryansmod.common.block.AleniumOre;
import ryansmod.RyansMod;

public class Generator implements IWorldGenerator {
public static Block AleniumOreGen = new ryansmod.common.block.AleniumOre();
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
        switch(world.provider.dimensionId){
        case -1:
            generateNether(world, random, chunkX * 16, chunkZ * 16);
            break;
        case 0:
            generateSurface(world, random, chunkX * 16, chunkZ * 16);
            break;
        case 1:
            generateEnd(world, random, chunkX * 16, chunkZ * 16);
            break;
        }

}

private void generateEnd(World world, Random random, int i, int j) {}

private void generateSurface(World world, Random random, int i, int j) {
                // Just copy the stuff below to spawn multiple kinds of ores. I hope its not to hard for you to read!
	//Number of clusters of the ore in question spawned
	for(int k = 0; k < 10; k++) {
		int AleniumOreXCoord = i + random.nextInt(16); //remember +i
		int AleniumOreYCoord = random.nextInt(14);
		int AleniumOreZCoord = j + random.nextInt(16); //remember +j
		//WordlGenMinable([block], [Number of block per cluster(?)])
		(new WorldGenMinable(RyansMod.aleniumOre, 5)).generate(world, random, AleniumOreXCoord, AleniumOreYCoord, AleniumOreZCoord);
	}
}

private void generateNether(World world, Random random, int i, int j) {}
}

 

And then in my main file I had it registered with:

 

    @EventHandler
    public void load(FMLInitializationEvent event) {
    		GameRegistry.registerWorldGenerator(new Generator(), 0); 
            proxy.registerRenderers();
    }

 

Hope this helps! Good luck on your mod!

 

Wow thanks that seems to have done the trick :) there all split up now and are spawning underground as well now :)

 

thanks again ill post back if I run into some problem with it but from what i can see it all working :)

Posted
  On 8/16/2014 at 5:03 AM, himan54 said:

Sure! I ask lots of questions and am always glad to help someone else. Glad it worked.  :D

 

Do you no how I would go about make filler blocks and the top layer spawn. apart from the ores i got to spawn in the world its all diamond blocks and i tried a few things but i can not see to find out how to do it.

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I am trying to install forge 1.20.1 but after installing java 8 144, it only quickly opens a cmd prompt then recloses it without anything else happening. Any help?
    • This is a hopefully quick question, but I'm tryin to slow down the player and have reduced the movement speed attribute, which works as long as the player is on the ground, however when the player is sprint jumping their speed is only slightly slower than a actual player(For reference there movement speed is 0.5 of it's original value)
    • Hello there! I developing a mod, that will be allow to spawn a hologram of the player. So i need, that a hologram has a skin of owner. I don't sure how to do that, 'cause if i just place a path to standart steve skin, that will lead for same skin on all holograms. Btw, is it posible to dynamicly add an another layer to player's skin? For creating a small diffusing. Can anyone share some ideas? (will be perfect if i don't must be use an openGL API and something)
    • I've been running a very old instance of Forge on my 1.18.2 server (40.2.5) and would like to upgrade it, but if I install any version past that, Minecraft won't load.  It doesn't crash, it just brings up the command prompt and hangs until I close it.  I'm guessing it's some sort of mod incompatibility, but I have no idea how to tell.  Here's my debug log: https://mclo.gs/7Chnf4a
    • Update your AMD/ATI drivers - get the drivers from their website - do not update via system  
×
×
  • Create New...

Important Information

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