Hey!
I am currently working on a mod that adds some ores to the End. The ores I have generating in the overworld work fine, however the ores that I have generating in the end just don't generate!
Here is one of my end ore generator classes:
package com.evanw1256.bote.generation;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import com.evanw1256.bote.init.ModBlocks;
import cpw.mods.fml.common.IWorldGenerator;
public class EndriteGenerator implements IWorldGenerator {
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
switch(world.provider.dimensionId)
{
case 0: generateSurface(random, chunkX*16, chunkZ*16, world); break;
case 1: generateEnd(random, chunkX*16, chunkZ*16, world); break;
case -1: generateNether(random, chunkX*16, chunkZ*16, world); break;
default:;
}
}
public void addOreSpawn(Block block, World world, Random random, int blockXPos, int blockZPos, int minVainSize, int maxVainSize, int chancesToSpawn, int minY, int maxY )
{
for(int i = 0; i < chancesToSpawn; i++)
{
int posX = blockXPos + random.nextInt(16);
int posY = minY + random.nextInt(maxY - minY);
int posZ = blockZPos + random.nextInt(16);
new WorldGenMinable(block, (minVainSize + random.nextInt(maxVainSize - minVainSize)), Blocks.stone).generate(world, random, posX, posY, posZ);
}
}
private void generateNether(Random random, int i, int j, World world) {
// TODO Auto-generated method stub
}
private void generateEnd(Random random, int i, int j, World world) {
// TODO Auto-generated method stub
addOreSpawn(ModBlocks.endriteOre, world, random, i, j, 2, 5, 70, 0, 100);
}
private void generateSurface(Random random, int chunkX, int chunkZ, World world) {
}
}
And then here is my generation init file:
package com.evanw1256.bote.init;
import com.evanw1256.bote.generation.EndriteGenerator;
import com.evanw1256.bote.generation.EnosGenerator;
import com.evanw1256.bote.generation.HemiteGenerator;
import com.evanw1256.bote.generation.TerriumGenerator;
import cpw.mods.fml.common.registry.GameRegistry;
public class ModGeneration {
public static void Init() {
GameRegistry.registerWorldGenerator(new HemiteGenerator(), 1);
GameRegistry.registerWorldGenerator(new TerriumGenerator(), 1);
GameRegistry.registerWorldGenerator(new EndriteGenerator(), 1);
GameRegistry.registerWorldGenerator(new EnosGenerator(), 1);
}
}