Jump to content

Recommended Posts

Posted (edited)

I'm having a serious issue with my ore generation, I'm attempting to generate certain ores in specific biomes but all I seem to get is EVERYTHING. 

nDZbIzY.png

 

Spoiler

package mikerman50.sc.worldgen;

import java.util.Random;

import mikerman50.sc.init.ModBlocks;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.state.pattern.BlockStateMatcher;
import net.minecraft.init.Biomes;
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.minecraftforge.fml.common.IWorldGenerator;

public class OreGen implements IWorldGenerator {

	public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider){
		switch (world.provider.getDimensionType())
		{
        case NETHER:
            generateNether(world, random, chunkX, chunkZ);
            break;
        case OVERWORLD:
            //Biome biome = world.getBiomeForCoordsBody(new BlockPos(chunkX * 16, 0, chunkZ * 16));
            generateOverworld(world, random, chunkX, chunkZ);
            break;

        case THE_END:
            generateEnd(world, random, chunkX, chunkZ);
            break;
            }
		}
	
	private void generateNether(World world, Random random, int worldX, int worldZ) {
    generateOre(ModBlocks.silverOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 40, 2, 8, 5);
}
//Utils.getLogger().info("added SimcraftOres");
    private void generateOverworld(World world, Random random, int worldX, int worldZ){
    
    int XX = worldX* 16;
	int ZZ = worldZ* 16;
	BlockPos pos = new BlockPos(XX, 70, ZZ);
	String biome = world.getBiomeForCoordsBody(pos).getBiomeName();//getWorldChunkManager().getBiomeGenAt(XX, ZZ);
    
    	//minY,maxY,minVein,maxVein,spawnChance
    	//Desert
    	if(Biomes.DESERT != null){//(biome, 2)){
            generateOre(ModBlocks.acanthiteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 60, 2, 8, 5);
            generateOre(ModBlocks.argentiteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 40, 54, 2, 6, 100);
            generateOre(ModBlocks.bariteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 25, 39, 2, 8, 100);
            generateOre(ModBlocks.cinnabarOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 18, 24, 2, 6, 100);
            generateOre(ModBlocks.corundumOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 10, 17, 2, 8, 100);
            generateOre(ModBlocks.pyrolusiteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 0, 9, 2, 6, 100);
            generateOre(ModBlocks.aburstoneOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 60, 2, 8, 100);
            generateOre(ModBlocks.badalstoneOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 2, 6, 100);
            generateOre(ModBlocks.carraramarbleOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 2, 8, 100);
            generateOre(ModBlocks.connemaramarbleOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 2, 6, 100);
            System.out.print("Desert ores generated");
            System.out.println(pos.getX() + " " + pos.getY() + " " + pos.getZ());
        //Desert Hills
    	}
    	else if(Biomes.DESERT_HILLS != null){//.(biome, 17))
        {
        	generateOre(ModBlocks.corundumOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 10, 17, 2, 8, 100);
        	generateOre(ModBlocks.pyrolusiteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 0, 9, 2, 6, 100);
            generateOre(ModBlocks.aburstoneOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 60, 2, 8, 100);
            generateOre(ModBlocks.carraramarbleOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 2, 8, 100);
            System.out.print("Desert Hills ores generated");
        //Beach
        }
       if(Biomes.DESERT != null)
        {
        	generateOre(ModBlocks.sulfurOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 25, 39, 2, 8, 100);
        	generateOre(ModBlocks.cinnabarOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 18, 24, 2, 6, 100);
            generateOre(ModBlocks.jasperstoneOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 60, 2, 8, 100);
            generateOre(ModBlocks.biancosivecmarbleOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 2, 6, 100);
            System.out.print("Beach ores generated");
        //Plains
        }
        if(Biomes.DESERT != null)
        {
        	generateOre(ModBlocks.boraxOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 55, 64, 2, 8, 100);
            generateOre(ModBlocks.bauxiteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 40, 54, 2, 6, 100);
            generateOre(ModBlocks.berylOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 25, 39, 2, 8, 100);
            generateOre(ModBlocks.leadOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 18, 24, 2, 6, 100);
            generateOre(ModBlocks.kimberliteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 10, 17, 2, 8, 100);
            generateOre(ModBlocks.manganeseOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 0, 9, 2, 6, 100);
            generateOre(ModBlocks.cahorsstoneOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 60, 2, 8, 100);
            generateOre(ModBlocks.darkverdestoneOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 2, 6, 100);
            generateOre(ModBlocks.creolemarbleOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 2, 8, 100);
            generateOre(ModBlocks.etowahmarbleOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 2, 6, 100);
            System.out.print("Plains ores generated");
        }

        //IcePlains
        if(Biomes.DESERT != null)
        	generateOre(ModBlocks.boraxOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 55, 64, 2, 8, 100);
        	generateOre(ModBlocks.berylOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 25, 39, 2, 8, 100);
        	generateOre(ModBlocks.kimberliteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 10, 17, 2, 8, 100);
        	generateOre(ModBlocks.cahorsstoneOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 60, 2, 8, 100);
        	generateOre(ModBlocks.darkverdestoneOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 2, 6, 100);
        	generateOre(ModBlocks.creolemarbleOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 2, 8, 100);
        	generateOre(ModBlocks.etowahmarbleOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 2, 6, 100);
        	System.out.print("Ice Plains ores generated");
        //Forest
    	 }
        if(Biomes.DESERT != null)
        {
        	generateOre(ModBlocks.quartzOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 55, 64, 2, 8, 100);
            generateOre(ModBlocks.chalcociteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 40, 54, 2, 6, 100);
            generateOre(ModBlocks.chromiteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 25, 39, 2, 8, 100);
            generateOre(ModBlocks.talcOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 18, 24, 2, 6, 100);
            generateOre(ModBlocks.emeryOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 10, 17, 2, 8, 100);
            generateOre(ModBlocks.rubyOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 0, 9, 2, 6, 100);
            generateOre(ModBlocks.gabbrostoneOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 60, 2, 8, 100);
            generateOre(ModBlocks.halifaxstoneOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 2, 6, 100);
            generateOre(ModBlocks.pentelicmarbleOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 2, 8, 100);
            generateOre(ModBlocks.purbeckmarbleOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 2, 6, 100);        
            System.out.print("Forest ores generated");
        }
        //ForestHills
        if(Biomes.DESERT != null)
        {
        	generateOre(ModBlocks.acanthiteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 55, 64, 2, 8, 100);
            generateOre(ModBlocks.talcOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 18, 24, 2, 6, 100);
            generateOre(ModBlocks.emeryOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 10, 17, 2, 8, 100);
            generateOre(ModBlocks.rubyOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 0, 9, 2, 6, 100);
            generateOre(ModBlocks.gabbrostoneOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 60, 2, 8, 100);
            generateOre(ModBlocks.pentelicmarbleOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 2, 8, 100);
            System.out.print("Forest Hills ores generated");
        }
        //ExtremeHills
        if(Biomes.DESERT != null)
        {
        	generateOre(ModBlocks.lazuriteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 55, 64, 2, 8, 100);
            generateOre(ModBlocks.borniteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 40, 54, 2, 6, 100);
            generateOre(ModBlocks.cassiteriteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 25, 39, 2, 8, 100);
            generateOre(ModBlocks.silverOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 18, 24, 2, 6, 100);
            generateOre(ModBlocks.malachiteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 10, 17, 2, 8, 100);
            generateOre(ModBlocks.sulfideOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 0, 9, 2, 6, 100);
            generateOre(ModBlocks.elbanstoneOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 60, 2, 8, 100);
            generateOre(ModBlocks.famosastoneOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 2, 6, 100);
            generateOre(ModBlocks.murphymarbleOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 2, 8, 100);
            generateOre(ModBlocks.parianmarbleOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 2, 6, 100);
            System.out.print("Extreeme Hills ores generated");
        }
        //ExtremeHillsEdge
        if(Biomes.DESERT != null)
        {
            generateOre(ModBlocks.silverOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 18, 24, 2, 6, 100);
            generateOre(ModBlocks.famosastoneOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 8, 10, 100);
            generateOre(ModBlocks.parianmarbleOre.getDefaultState(), Blocks.DIRT, random, world, worldX, worldZ, 5, 64, 7, 12, 3);
            System.out.print("Extreme Hills Edge ores generated");
        }
        //IceMountains
        if(Biomes.DESERT != null)
        {
            generateOre(ModBlocks.molybdeniteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 55, 64, 2, 8, 100);
            generateOre(ModBlocks.seleniumOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 18, 24, 2, 6, 100);
            generateOre(ModBlocks.famosastoneOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 8, 10, 100);
            generateOre(ModBlocks.parianmarbleOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 7, 12, 3);
            System.out.print("Ice Mountains ores generated");
        }
        //Swampland
        if(Biomes.DESERT != null)
        {
        	generateOre(ModBlocks.sulfurOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 55, 64, 2, 8, 100);
            generateOre(ModBlocks.kyaniteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 40, 54, 2, 6, 100);
            generateOre(ModBlocks.hematiteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 25, 39, 2, 8, 100);
            generateOre(ModBlocks.limoniteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 18, 24, 2, 6, 100);
            generateOre(ModBlocks.uraniniteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 10, 17, 2, 8, 100);
            generateOre(ModBlocks.sulfideOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 0, 9, 2, 6, 100);
            generateOre(ModBlocks.kersantitestoneOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 60, 2, 8, 100);
            generateOre(ModBlocks.languedocstoneOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 2, 6, 100);
            generateOre(ModBlocks.ruskealamarbleOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 2, 8, 100);
            generateOre(ModBlocks.sylacaugamarbleOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 2, 6, 100);
            System.out.print("SwampLand ores generated");
        }
        //Taiga
        if(Biomes.DESERT != null)
        {
        	generateOre(ModBlocks.bariumOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 55, 64, 2, 8, 100);
            generateOre(ModBlocks.galenaOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 40, 54, 2, 6, 100);
            generateOre(ModBlocks.cobaltiteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 25, 39, 2, 8, 100);
            generateOre(ModBlocks.ilmeniteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 18, 24, 2, 6, 100);
            generateOre(ModBlocks.ikraniteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 10, 17, 2, 8, 100);
            generateOre(ModBlocks.jadeiteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 0, 9, 2, 6, 100);
            generateOre(ModBlocks.imperialstoneOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 60, 2, 8, 100);
            generateOre(ModBlocks.jasperstoneOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 2, 6, 100);
            generateOre(ModBlocks.swedishgreenmarbleOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 2, 8, 100);
            generateOre(ModBlocks.biancosivecmarbleOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 2, 6, 100);
        }
        //TaigaHills
        if(Biomes.DESERT != null)
        {
        	generateOre(ModBlocks.bariumOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 55, 64, 2, 8, 100);
            generateOre(ModBlocks.cobaltiteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 25, 39, 2, 8, 100);
            generateOre(ModBlocks.ikraniteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 10, 17, 2, 8, 100);
            generateOre(ModBlocks.imperialstoneOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 60, 2, 8, 100);
            generateOre(ModBlocks.swedishgreenmarbleOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 2, 8, 100);
        }
        //Ocean
        if(Biomes.DESERT != null)
        {
            generateOre(ModBlocks.molybdeniteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 40, 54, 2, 6, 100);
            generateOre(ModBlocks.pentlanditeOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 25, 39, 2, 8, 100);
            generateOre(ModBlocks.apatiteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 18, 24, 2, 6, 100);
            generateOre(ModBlocks.seleniumOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 10, 17, 2, 8, 100);
            generateOre(ModBlocks.azuriteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 0, 9, 2, 6, 100);
            generateOre(ModBlocks.macedonianstoneOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 60, 2, 8, 100);
            generateOre(ModBlocks.nashuastoneOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 2, 6, 100);
            generateOre(ModBlocks.tennesseemarbleOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 2, 8, 100);
            generateOre(ModBlocks.vermontmarbleOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 2, 6, 100);
        }
        //FrozenOcean
        if(Biomes.DESERT != null)
        {
            generateOre(ModBlocks.pentlanditeOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 25, 39, 2, 8, 100);
            generateOre(ModBlocks.apatiteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 18, 24, 2, 6, 100);
            generateOre(ModBlocks.seleniumOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 10, 17, 2, 8, 100);
            generateOre(ModBlocks.azuriteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 0, 9, 2, 6, 100);
            generateOre(ModBlocks.macedonianstoneOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 60, 2, 8, 100);
            generateOre(ModBlocks.nashuastoneOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 2, 6, 100);
            generateOre(ModBlocks.tennesseemarbleOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 2, 8, 100);
            generateOre(ModBlocks.vermontmarbleOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 2, 6, 100);
        }
        //Jungle
        if(Biomes.DESERT != null)
        {
        	generateOre(ModBlocks.scheeliteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 55, 64, 2, 8, 100);
            generateOre(ModBlocks.sphaleriteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 40, 54, 2, 6, 100);
            generateOre(ModBlocks.wolframiteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 25, 39, 2, 8, 100);
            generateOre(ModBlocks.nephelineOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 18, 24, 2, 6, 100);
            generateOre(ModBlocks.coltanOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 10, 17, 2, 8, 100);
            generateOre(ModBlocks.dolomiteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 0, 9, 2, 6, 100);
            generateOre(ModBlocks.oglesbystoneOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 60, 2, 8, 100);
            generateOre(ModBlocks.painswickstoneOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 2, 6, 100);
            generateOre(ModBlocks.yulemarbleOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 2, 8, 100);
            generateOre(ModBlocks.wunsiedelmarbleOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 2, 6, 100);
        }
        //JungleHills
        if(Biomes.DESERT != null)
        {
        	
            generateOre(ModBlocks.nephelineOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 18, 24, 2, 6, 100);
            generateOre(ModBlocks.dolomiteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 10, 17, 2, 8, 100);
            generateOre(ModBlocks.coltanOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 0, 9, 2, 6, 100);
            generateOre(ModBlocks.painswickstoneOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 60, 2, 8, 100);
            generateOre(ModBlocks.wunsiedelmarbleOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 5, 64, 2, 6, 100);
        }
        //River
        if(Biomes.DESERT != null)
        {
            generateOre(ModBlocks.rivergoldOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 40, 64, 10, 24, 100);
            generateOre(ModBlocks.rivergoldOre.getDefaultState(), Blocks.DIRT, random, world, worldX, worldZ, 50, 255, 7, 12, 100);
            generateOre(ModBlocks.rivergoldOre.getDefaultState(), Blocks.CLAY, random, world, worldX, worldZ, 50, 255, 7, 12, 100);
            
        }
        //FrozenRiver
        if(Biomes.DESERT != null)
        {
            generateOre(ModBlocks.rivergoldOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 40, 64, 10, 24, 100);
        }
        
      //HEll
        if(Biomes.DESERT != null)
        {
            generateOre(ModBlocks.cassiteriteOre.getDefaultState(), Blocks.NETHERRACK, random, world, worldX, worldZ, 40, 64, 10, 24, 100);
        }
        //Sky
        if(Biomes.DESERT != null)
        {
            generateOre(ModBlocks.cassiteriteOre.getDefaultState(), Blocks.STONE, random, world, worldX, worldZ, 40, 64, 10, 24, 100);
            
        }
        //Everywhere
        if(Biomes.DEFAULT != null)
        {
        	}
        }	
   	public void generateEnd(World world, Random rand, int worldX, int worldZ){
        generateOre(ModBlocks.cassiteriteOre.getDefaultState(), Blocks.STONE, rand, world, worldX, worldZ, 40, 64, 10, 24, 100);
   	}                                                                                 //minY,maxY,minVein,maxVein,spawnChance
		private void generateOre(IBlockState state,  Block generateIn, Random random, World world, int chunkX, int chunkZ, 
				int minY, int maxY, int minVeinSize, int maxVeinSize, int chance){
			int vienSize = minVeinSize + random.nextInt(maxVeinSize - minVeinSize);
			int heightRange = maxY - minY + 1;
            WorldGenMinable gen = new WorldGenMinable(state, vienSize, BlockStateMatcher.forBlock(generateIn));
    		for(int i =0; i < chance; i++){
    			int xRand = chunkX * 16 + random.nextInt(16);
    			int yRand = random.nextInt(heightRange) + minY;
    			int zRand = chunkZ * 16 + random.nextInt(16);
    			//Block testblock = world.getBlock(xRand, yRand, zRand);
    			BlockPos pos = new BlockPos(xRand, yRand, zRand);
    			
    			gen.generate(world, random, pos);
        }
    }
  }

Code here

 

 

Edited by Mikerman50
PROBLEM SOLVED.
Posted
String biome = world.getBiomeForCoordsBody(pos).getBiomeName();

And you do dick with this value.

if(Biomes.DESERT != null)

This will never be false.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted
2 minutes ago, Differentiation said:

May I ask how in the world do you have the time to create ALL those new ores? xD

we've had all these ores since 1.2.5, last public release was in 1.6.4 main dev left, I picked up the pieces ( I can't code) 

Posted
3 hours ago, Mikerman50 said:

we've had all these ores since 1.2.5, last public release was in 1.6.4 main dev left, I picked up the pieces ( I can't code) 

Oh...

You should've made biome return Biomes, not String.

Just a small tip!

Posted
7 minutes ago, Differentiation said:

Oh...

You should've made biome return Biomes, not String.

Just a small tip!

Wrong. It should be Biome. Your advice is like saying "when you get a block, you want the variable to be Blocks."

 

Biome is the object, Biomes is where the game holds a reference to each biome.

  • Like 1

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted
Just now, Draco18s said:

Wrong. It should be Biome. Your advice is like saying "when you get a block, you want the variable to be Blocks."

 

Biome is the object, Biomes is where the game holds a reference to each biome.

Well I don't know the exact class...... but somewhere close.

Posted (edited)
On 10/21/2017 at 1:48 PM, Mikerman50 said:

I'm having a serious issue with my ore generation

Next time you get inexplicable run-time behavior, step through your code at least once in the debugger before running for help. You'd see something like a test that's always true before posting it.

 

On 10/21/2017 at 3:27 PM, Mikerman50 said:

main dev left, I picked up the pieces ( I can't code) 

You really don't want to admit that around here (see the warnings on the forum and in mods' signatures).  Find someone near you to help with programming and Eclipse (or other IDE) expertise so that the problems you bring here will be specific to the idiosyncrasies of Minecraft and Forge.

Edited by jeffryfisher

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

Posted

HI, thanks for your reply, I have spent several hours daily running through different possible causes, cant say that the debug on eclipse helps me at all.  it just runs like normal.

 

I'm not one to care what people put in their signatures, unfortunately I fall into a category a "Kinesthetic learner". so anyone that goes and says learn has no idea of how difficult it is.

 

I'm not looking for all the answers, just pointers, it's nothing new what i'm looking for, it's just rare to find anything that has been done recently. 

Posted
46 minutes ago, Mikerman50 said:

HI, thanks for your reply, I have spent several hours daily running through different possible causes, cant say that the debug on eclipse helps me at all.  it just runs like normal.

Add breakpoints.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted
49 minutes ago, Mikerman50 said:

HI, thanks for your reply, I have spent several hours daily running through different possible causes, cant say that the debug on eclipse helps me at all.  it just runs like normal.

 

There are two types of debug. First you can use the debug mode of Eclipse (along with breakpoints as mentioned). The problem with this method is that anything that takes a long time or takes specific gameplay can be difficult to capture because if the breakpoint happens every tick you won't be able to play the game. 

 

So the alternative is to simply use console (or logger) print statements. In each of your functions put a print statement that (a) proves which code path is executing (b) prints out any important field values.

 

Both of these methods essentially "trace" the code execution. Since computers are purely logical, by careful tracing you can always debug easily. You should see right away whether it is generating different ores than you expect, you should be able to trace that back to what biome it thinks it is in, and so forth.

 

The key point is that programmers don't really debug by reading code (especially other people's code), rather they trace the execution and also create alternative versions of the code to help isolate the problem. It will really help your modding (and general programming) ability to get used to tracing your code.

  • Like 1

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted
2 minutes ago, jabelar said:

So the alternative is to simply use console (or logger) print statements. In each of your functions put a print statement that (a) proves which code path is executing (b) prints out any important field values.

 

You should see right away whether it is generating different ores than you expect, you should be able to trace that back to what biome it thinks it is in, and so forth.

Thanks for this reply Jabelar, you did some great tutorials in the past. 

 

I shall have a look into break points, I have several paperback versions on learn to program in 24 hours from Cadence but its just not my learning style annoyingly,  as I've said. I'm sure the answer is obvious for someone out there

Posted
On 10/24/2017 at 0:25 PM, Mikerman50 said:

cant say that the debug on eclipse helps me at all.  it just runs like normal.

Sorry, I've been doing this so long that I forgot how special words like "step" might have no meaning to someone who has never used a debugger before. "Step" implies setting and triggering a breakpoint, and then using the debugger's step controls to execute one line or method call at a time. You can step into or over each line of the program, and at each line, you can examine all of the currently set fields and local variables.

 

This forum teaches Minecraft and Forge. It is not a Java help desk, never mind being an intro to programming class. If I understand that correctly, it means that you should know how to use the essential tools of programming, which include the debugger, hence my signature.

 

There's lots online about Eclipse. You should be able to find several video tutorials on how to use the debugger. Fire up your own Eclipse, play an Eclipse tutorial video, and follow along.

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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