Jump to content

Recommended Posts

Posted

I am making ore to generate into the overworld and some in the end and nether

 

I have put the three that spawn in the overworld into the code now

 

I am just wondering if this looks ok :)

 

package assassinhero.parallelworlds.common;

import java.util.Random;

import assassinhero.parallelworlds.ParallelWorlds;

import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import cpw.mods.fml.common.IWorldGenerator;

public class WorldGenerator implements IWorldGenerator{

@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);

	}

}

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


}

private void generateSurface(World world, Random random, int i, int j) {
	for(int k = 0; k < 10; k++){
		int NightOreXCoord = i + random.nextInt(16);
		int NightOreYCoord = random.nextInt(25);
		int NightOreZCoord = j + random.nextInt(16);

		(new WorldGenMinable(ParallelWorlds.NightOre.blockID, 5)).generate(world, random, NightOreXCoord, NightOreYCoord, NightOreZCoord);

	}

	for(int l = 0; l < 10; l++){
		int TimeOreXCoord = i + random.nextInt(16);
		int TimeOreYCoord = random.nextInt(15);
		int TimeOreZCoord = j + random.nextInt(16);

		(new WorldGenMinable(ParallelWorlds.TimeOre.blockID, 4)).generate(world, random, TimeOreXCoord, TimeOreYCoord, TimeOreZCoord);
	}

	for(int m = 0; m < 10; m++){
		int HeavenlyOreXCoord = i + random.nextInt(16);
		int HeavenlyOreYCoord = random.nextInt(30);
		int HeavenlyOreZCoord = j + random.nextInt(16);

		(new WorldGenMinable(ParallelWorlds.HeavenlyOre.blockID, 5)).generate(world, random, HeavenlyOreXCoord, HeavenlyOreYCoord, HeavenlyOreZCoord);

	}




}

STOP CRUCIFYING NEW MODDERS!!!!

Posted

What does WorldGenMinable do?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Oh, a vanilla class.

 

*Peers at it*

 

That looks like it should work.  But only for the overworld  WorldGenMinable's generate calls block.isGenMineableReplaceable which will only return true for smooth stone.

 

Don't even ask me why it takes a world, x, y, and z parameters, it doesn't use them.  No really:

 

public boolean isGenMineableReplaceable(World world, int x, int y, int z)
    {
        return blockID == stone.blockID;
    }

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Don't even ask me why it takes a world, x, y, and z parameters, it doesn't use them.  No really:

 

public boolean isGenMineableReplaceable(World world, int x, int y, int z)
    {
        return blockID == stone.blockID;
    }

 

Beacuse it's possible to override it. And then the world etc. come inn handy.

If you guys dont get it.. then well ya.. try harder...

Posted

Beacuse it's possible to override it. And then the world etc. come inn handy.

 

What I mean is, I don't know why the coordinates of the block are relevant.

 

I mean, we already did this: Block block = Block.blocksList[par1World.getBlockId(var38, var41, var44)];

 

So we're already looking at the block that we want to replace, why would we want that block's mine-ability to be based on...not itself?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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.