Jump to content

Artemis

Members
  • Posts

    1
  • Joined

  • Last visited

Everything posted by Artemis

  1. This is how to do what you are saying. Create a class that extends WorldGenLakes and implements IWorldGenerator. Then, register a copy of it specifying your oil block as the block type. import java.util.Random; import cpw.mods.fml.common.IWorldGenerator; import net.minecraft.block.Block; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenLakes; public class OilLakeWorldGenerator extends WorldGenLakes implements IWorldGenerator{ // Constructors. public OilLakeWorldGenerator(Block fluidBlock) { super(fluidBlock); } // Methods. @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { int x = (chunkX*16) + random.nextInt(16) + 8; int y = random.nextInt(256); int z = (chunkZ*16) + random.nextInt(16) + 8; super.generate(world, random, x, y, z); } } Change the y when you want it to spawn at only certain levels.
×
×
  • Create New...

Important Information

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