I'm trying to generate an ore in the overworld, and I purposely set the spawn rate on high to find it. I made a new world, but nothing spawned. I'm running Minecraft 1.5.1.
public final static EnumToolMaterial MALACHITE = EnumHelper.addToolMaterial("MALACHITE", 2, 1000, 8.0F, 3, 11);
@Instance("BaseMod")
public static BaseMod instance;
@SidedProxy(clientSide = "deathman12e3.ExtendedOres.ClientProxy", serverSide = "deathman12e3.ExtendedOres.CommonProxy")
public static CommonProxy proxy;
@PreInit
public void preInit(FMLPreInitializationEvent event)
{
Configuration config = new Configuration(event.getSuggestedConfigurationFile());
config.load();
int malachiteOreID = config.getBlock("MalachiteOre", 3000).getInt();
int malachiteBlockID = config.getBlock("MalachiteBlock", 3001).getInt();
int malachiteClumpID = config.getItem("MalachiteClump", 16000).getInt();
int malachiteIngotID = config.getItem("MalachiteIngot", 16001).getInt();
int malachiteSwordID = config.getItem("MalachiteSword", 16002).getInt();
int malachiteShovelID = config.getItem("MalachiteShovel", 16003).getInt();
int malachitePickID = config.getItem("MalachitePick", 16004).getInt();
int malachiteAxeID = config.getItem("MalachiteAxe", 16005).getInt();
int malachiteHoeID = config.getItem("MalachiteHoe", 16006).getInt();
malachiteOre = (new BlockMalachiteOre(malachiteOreID));
malachiteBlock = (new BlockMalachite(malachiteBlockID, Material.iron));
malachiteClump = (new ItemMalachiteClump(malachiteClumpID));
malachiteIngot = (new ItemMalachiteIngot(malachiteIngotID));
malachiteSword = (new ItemMalachiteSword(malachiteSwordID, MALACHITE));
malachiteShovel = (new ItemMalachiteShovel(malachiteShovelID, MALACHITE));
malachitePick = (new ItemMalachitePick(malachitePickID, MALACHITE));
malachiteAxe = (new ItemMalachiteAxe(malachiteAxeID, MALACHITE));
malachiteHoe = (new ItemMalachiteHoe(malachiteHoeID, MALACHITE));
}
@Init
public void load(FMLInitializationEvent event)
{
GameRegistry.registerBlock(malachiteOre, "malachiteOre");
LanguageRegistry.addName(malachiteOre, "Malachite Ore");
MinecraftForge.setBlockHarvestLevel(malachiteOre, "pickaxe", 2);
GameRegistry.addRecipe(new ItemStack(malachiteBlock), "III", "III", "III", 'I', malachiteIngot);
GameRegistry.registerBlock(malachiteBlock, "malachiteBlock");
LanguageRegistry.addName(malachiteBlock, "Malachite Block");
MinecraftForge.setBlockHarvestLevel(malachiteBlock, "pickaxe", 2);
LanguageRegistry.addName(malachiteClump, "Malachite Clump");
GameRegistry.addSmelting(malachiteClump.itemID, new ItemStack(malachiteIngot), 10.0F);
LanguageRegistry.addName(malachiteIngot, "Malachite Ingot");
LanguageRegistry.addName(malachiteSword, "Malachite Sword");
GameRegistry.addRecipe(new ItemStack(malachiteSword), " I ", " I ", " S ", 'I', malachiteIngot, 'S', Item.stick);
LanguageRegistry.addName(malachiteShovel, "Malachite Shovel");
GameRegistry.addRecipe(new ItemStack(malachiteShovel), " I ", " S ", " S ", 'I', malachiteIngot, 'S', Item.stick);
LanguageRegistry.addName(malachitePick, "Malachite Pickaxe");
GameRegistry.addRecipe(new ItemStack(malachitePick), "III", " S ", " S ", 'I', malachiteIngot, 'S', Item.stick);
LanguageRegistry.addName(malachiteAxe, "Malachite Axe");
GameRegistry.addRecipe(new ItemStack(malachiteAxe), "II ", "IS ", " S ", 'I', malachiteIngot, 'S', Item.stick);
LanguageRegistry.addName(malachiteHoe, "Malachite Hoe");
GameRegistry.addRecipe(new ItemStack(malachiteHoe), "II ", " S ", " S ", 'I', malachiteIngot, 'S', Item.stick);
}
@PostInit
public void postInit(FMLPostInitializationEvent event)
{
}
public static Block malachiteOre;
public static int malachiteOreID;
public static Block malachiteBlock;
public static int malachiteBlockID;
public static Item malachiteClump;
public static int malachiteClumpID;
public static Item malachiteIngot;
public static int malachiteIngotID;
public static ItemSword malachiteSword;
public static int malachiteSwordID;
public static ItemSpade malachiteShovel;
public int malachiteShovelID;
public static ItemPickaxe malachitePick;
public int malachitePickID;
public static ItemAxe malachiteAxe;
public int malachiteAxeID;
public static ItemHoe malachiteHoe;
public int malachiteHoeID;
BaseMod:
package deathman12e3.ExtendedOres;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemAxe;
import net.minecraft.item.ItemHoe;
import net.minecraft.item.ItemPickaxe;
import net.minecraft.item.ItemSpade;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.EnumHelper;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.Property;
@Mod(modid = "ExtendedOres", name = "Extended ores", version = "1.0.0")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class BaseMod
{
public final static EnumToolMaterial MALACHITE = EnumHelper.addToolMaterial("MALACHITE", 2, 1000, 8.0F, 3, 11);
@Instance("BaseMod")
public static BaseMod instance;
@SidedProxy(clientSide = "deathman12e3.ExtendedOres.ClientProxy", serverSide = "deathman12e3.ExtendedOres.CommonProxy")
public static CommonProxy proxy;
@PreInit
public void preInit(FMLPreInitializationEvent event)
{
Configuration config = new Configuration(event.getSuggestedConfigurationFile());
config.load();
int malachiteOreID = config.getBlock("MalachiteOre", 3000).getInt();
int malachiteBlockID = config.getBlock("MalachiteBlock", 3001).getInt();
int malachiteClumpID = config.getItem("MalachiteClump", 16000).getInt();
int malachiteIngotID = config.getItem("MalachiteIngot", 16001).getInt();
int malachiteSwordID = config.getItem("MalachiteSword", 16002).getInt();
int malachiteShovelID = config.getItem("MalachiteShovel", 16003).getInt();
int malachitePickID = config.getItem("MalachitePick", 16004).getInt();
int malachiteAxeID = config.getItem("MalachiteAxe", 16005).getInt();
int malachiteHoeID = config.getItem("MalachiteHoe", 16006).getInt();
configFlag = config.get(Configuration.CATEGORY_GENERAL, "configFlag", false).getBoolean(false);
Property property = config.get(Configuration.CATEGORY_GENERAL, "configString", "Randomness");
property.comment = "This is a comment.";
String configString = property.comment;
config.save();
malachiteOre = (new BlockMalachiteOre(malachiteOreID));
malachiteBlock = (new BlockMalachite(malachiteBlockID, Material.iron));
malachiteClump = (new ItemMalachiteClump(malachiteClumpID));
malachiteIngot = (new ItemMalachiteIngot(malachiteIngotID));
malachiteSword = (new ItemMalachiteSword(malachiteSwordID, MALACHITE));
malachiteShovel = (new ItemMalachiteShovel(malachiteShovelID, MALACHITE));
malachitePick = (new ItemMalachitePick(malachitePickID, MALACHITE));
malachiteAxe = (new ItemMalachiteAxe(malachiteAxeID, MALACHITE));
malachiteHoe = (new ItemMalachiteHoe(malachiteHoeID, MALACHITE));
}
@Init
public void load(FMLInitializationEvent event)
{
proxy.registerRenderers();
GameRegistry.registerWorldGenerator(new OreGenHandler());
GameRegistry.registerBlock(malachiteOre, "malachiteOre");
LanguageRegistry.addName(malachiteOre, "Malachite Ore");
MinecraftForge.setBlockHarvestLevel(malachiteOre, "pickaxe", 2);
GameRegistry.addRecipe(new ItemStack(malachiteBlock), "III", "III", "III", 'I', malachiteIngot);
GameRegistry.registerBlock(malachiteBlock, "malachiteBlock");
LanguageRegistry.addName(malachiteBlock, "Malachite Block");
MinecraftForge.setBlockHarvestLevel(malachiteBlock, "pickaxe", 2);
LanguageRegistry.addName(malachiteClump, "Malachite Clump");
GameRegistry.addSmelting(malachiteClump.itemID, new ItemStack(malachiteIngot), 10.0F);
LanguageRegistry.addName(malachiteIngot, "Malachite Ingot");
LanguageRegistry.addName(malachiteSword, "Malachite Sword");
GameRegistry.addRecipe(new ItemStack(malachiteSword), " I ", " I ", " S ", 'I', malachiteIngot, 'S', Item.stick);
LanguageRegistry.addName(malachiteShovel, "Malachite Shovel");
GameRegistry.addRecipe(new ItemStack(malachiteShovel), " I ", " S ", " S ", 'I', malachiteIngot, 'S', Item.stick);
LanguageRegistry.addName(malachitePick, "Malachite Pickaxe");
GameRegistry.addRecipe(new ItemStack(malachitePick), "III", " S ", " S ", 'I', malachiteIngot, 'S', Item.stick);
LanguageRegistry.addName(malachiteAxe, "Malachite Axe");
GameRegistry.addRecipe(new ItemStack(malachiteAxe), "II ", "IS ", " S ", 'I', malachiteIngot, 'S', Item.stick);
LanguageRegistry.addName(malachiteHoe, "Malachite Hoe");
GameRegistry.addRecipe(new ItemStack(malachiteHoe), "II ", " S ", " S ", 'I', malachiteIngot, 'S', Item.stick);
}
@PostInit
public void postInit(FMLPostInitializationEvent event)
{
}
public static Block malachiteOre;
public static int malachiteOreID;
public static Block malachiteBlock;
public static int malachiteBlockID;
public static Item malachiteClump;
public static int malachiteClumpID;
public static Item malachiteIngot;
public static int malachiteIngotID;
public static ItemSword malachiteSword;
public static int malachiteSwordID;
public static ItemSpade malachiteShovel;
public int malachiteShovelID;
public static ItemPickaxe malachitePick;
public int malachitePickID;
public static ItemAxe malachiteAxe;
public int malachiteAxeID;
public static ItemHoe malachiteHoe;
public int malachiteHoeID;
public static boolean configFlag;
}
OreGenHandler:
package deathman12e3.ExtendedOres;
import java.util.Random;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import cpw.mods.fml.common.IWorldGenerator;
public class OreGenHandler implements IWorldGenerator
{
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
switch (world.provider.dimensionId)
{
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
}
}
private void generateSurface(World world, Random random, int blockX, int blockZ)
{
for (int x = 0; x < 64; x++)
{
int Xcoord = blockX + random.nextInt(16);
int Ycoord = random.nextInt(100);
int Zcoord = blockZ + random.nextInt(16);
(new WorldGenMinable(BaseMod.malachiteOre.blockID, random.nextInt(4))).generate(world, random, Xcoord, Ycoord, Zcoord);
}
}
}