Jump to content

Recommended Posts

Posted

package com.Ruby.RubyMod;

 

import java.util.Random;

 

import cpw.mods.fml.common.IWorldGenerator;

import net.minecraft.world.World;

import net.minecraft.world.chunk.IChunkProvider;

import net.minecraft.world.gen.feature.WorldGenMinable;

 

public class WorldGenRuby implements IWorldGenerator{

 

public void generate(Random rand, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider){

switch (world.provider.dimensionId){

case -1:

generateNether(world, rand, chunkX * 16, chunkZ * 16);

case 0:

generateSurface(world, rand, chunkX * 16, chunkZ * 16);

}

}

 

private void generateSurface(World world, Random rand, int chunkX, int chunkZ){

for (int i = 0; i < 50000; i++){ // make 100 less then less spawn in 1 chunk

int randPosX = chunkX + rand.nextInt(16);

int randPosY = rand.nextInt(64); //From 0 to 64 Y cords

int randPosZ = chunkZ + rand.nextInt(16);

 

    (new WorldGenMinable(RubyMod.RubyOre, 10)).generate(world, rand, randPosX, randPosY , randPosZ);

}

}

 

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

 

}

 

public static void register() {

 

}

}

 

 

 

 

 

Is my code

NEWB! in java im sorry :/

Posted

I realy dont get it this is the code

 

 

package com.Ruby.RubyMod;

 

import java.util.Random;

 

import cpw.mods.fml.common.IWorldGenerator;

import net.minecraft.world.World;

import net.minecraft.world.chunk.IChunkProvider;

import net.minecraft.world.gen.feature.WorldGenMinable;

 

public class WorldGenRuby implements IWorldGenerator{

 

public void generate(Random rand, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider){

switch (world.provider.dimensionId){

case -1:

generateNether(world, rand, chunkX * 16, chunkZ * 16);

case 0:

generateSurface(world, rand, chunkX * 16, chunkZ * 16);

}

}

 

private void generateSurface(World world, Random rand, int chunkX, int chunkZ){

for (int i = 0; i < 50000; i++){ // make 100 less then less spawn in 1 chunk

int randPosX = chunkX + rand.nextInt(16);

int randPosY = rand.nextInt(64); //From 0 to 64 Y cords

int randPosZ = chunkZ + rand.nextInt(16);

 

    (new WorldGenMinable(RubyMod.RubyOre, 10)).generate(world, rand, randPosX, randPosY , randPosZ);

}

}

 

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

 

}

 

public static void register() {

 

}

}

 

NEWB! in java im sorry :/

Posted

No, that's the Worldgen code. Post your main class. If you don't get it, follow a basic Java tutorial. You have to register your world generator.

Check out my mod, Realms of Chaos, here.

 

If I helped you, be sure to press the "Thank You" button!

Posted

Yeah, the register() method in WorldGenRuby that you are calling is empty. How is it supposed to do anything if you arent telling it to? Use this to register the WorldGenerator:

GameRegistry.registerWorldGenerator(new WorldGenRuby(), 1);

Check out my mod, Realms of Chaos, here.

 

If I helped you, be sure to press the "Thank You" button!

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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