I created my OreGenerator for my mod and I seem to be having some loading issues in the game and when the world is loading. Any assistance would be appreciated!
package com.heg.hegmod.worldgen;
import java.util.Random;
import com.heg.hegmod.init.ModBlocks;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkGenerator;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import net.minecraft.world.gen.feature.WorldGenerator;
import net.minecraftforge.fml.common.IWorldGenerator;
public class OreGen implements IWorldGenerator {
// 0=Overworld 1=End -1=Nether
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator,IChunkProvider chunkProvider) {
Generate(WorldGenStrings.bleumondore, world, random, chunkX, chunkZ, 16, 0, 256, Blocks.STONE);
}
public OreGen(){
WorldGenStrings.bleumondore = new WorldGenMinable(ModBlocks.bleumondore.getDefaultState(),8);
}
private void Generate(WorldGenerator generator, World world, Random rand, int chunkX, int chunkZ, int chancesToSpawn, int minHeight, int maxHeight, Block generateIn){
if(minHeight < 0 || maxHeight > 256 || minHeight > maxHeight)
throw new IllegalArgumentException("Illegal Height Arguments for WorldGenerator");
int heightDiff = maxHeight - minHeight +1;
for(int i = 0; i < chancesToSpawn; i++){
int x = chunkX * 16 + rand.nextInt(16);
int y = minHeight + rand.nextInt(heightDiff);
int z = chunkZ * 16 + rand.nextInt(16);
generator.generate(world, rand, new BlockPos(x,y,z));
}
}
}
I created my OreGenerator for my mod and I seem to be having some loading issues in the game and when the world is loading. Any assistance would be appreciated!