package infstudio.exoticpower;
import net.minecraft.block.Block;
import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import net.minecraftforge.fml.common.IWorldGenerator;
import java.util.Random;
public class EPGenerator implements IWorldGenerator {
@Override
public void generate(Random random, int chunkX, int chunkZ, World world,
IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
switch (world.provider.getDimensionId()) {
case 1:
generateEnd(world, random, chunkX, chunkZ);
break;
case 0:
generateOverworld(world, random, chunkX, chunkZ);
break;
case -1:
generateNether(world, random, chunkX, chunkZ);
break;
}
}
public void generateEnd(World world, Random rand, int x, int z) {
}
public void generateOverworld(World world, Random rand, int x, int z) {
}
public void generateNether(World world, Random rand, int x, int z) {
}
public void generateOre(Block block, World world, Random random, int chunkX, int chunkZ, int minVienSize, int maxVienSize, int chance, int minY, int maxY, Block generateIn) {
int vienSize = minVienSize + random.nextInt(maxVienSize - minVienSize);
int heightRange = maxY - minY;
WorldGenMinable gen = new WorldGenMinable(block.getDefaultState(), vienSize);
for (int i = 0; i < chance; i++) {
int xRand = chunkX * 16 + random.nextInt(16);
int yRand = random.nextInt(heightRange) + minY;
int zRand = chunkX * 16 + random.nextInt(16);
gen.generate(world, random, new BlockPos(xRand, yRand, zRand));
}
}
}