package com.allforfunmc.allforfuncore;

import java.util.ArrayList;
import java.util.Random;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

@Mod(modid = "Core", name = "AllForFun's Modpack Core", version = "1")
public class Core {
	public static final Boolean DebugMode = false;
	
	public static void Debug(Object Message){
		if(Core.DebugMode) {System.out.println(Message);}
	}
    @Instance(value = "GenericModID")
    public static Core instance;
    @SidedProxy(clientSide = "com.allforfunmc.allforfuncore.ClientProxy", serverSide = "com.allforfunmc.allforfuncore.CommonProxy")
    public static CommonProxy proxy;

    @EventHandler()
    public void load(FMLInitializationEvent event) {
	proxy.registerRenderers();
    }

    @EventHandler()
    public void postInit(FMLInitializationEvent event) {

    }

    // Below is custom code for the mod -- used in all of AllForFun's Mods.
    public static final CreativeTabs AllForFunItems = new CreativeTabs(CreativeTabs.getNextID(), "AllForFun's Items") {
	@Override
	@SideOnly(Side.CLIENT)
	public Item getTabIconItem() {
	    return com.allforfunmc.refineddiamond.Code.refinedDiamond;
	}
    };
    public static final CreativeTabs AllForFunFood = new CreativeTabs(CreativeTabs.getNextID(), "AllForFun's Food") {
	@Override
	@SideOnly(Side.CLIENT)
	public Item getTabIconItem() {
	    return com.allforfunmc.chocolatestuff.Code.chocolateBar;
	}
    };
    public static final CreativeTabs AllForFunArmor = new CreativeTabs(CreativeTabs.getNextID(), "AllForFun's Armor") {
	@Override
	@SideOnly(Side.CLIENT)
	public Item getTabIconItem() {
	    return com.allforfunmc.moreoresandmore.Main.armorCobbleChest;
	}
    };
    public static final CreativeTabs AllForFunBlocks = new CreativeTabs(CreativeTabs.getNextID(), "AllForFun's Blocks") {
	@Override
	@SideOnly(Side.CLIENT)
	public Item getTabIconItem() {
	    return Item.getItemFromBlock(com.allforfunmc.refineddiamond.Code.Refined_Diamond_Block);
	}
    };
    public static final CreativeTabs AllForFunTools = new CreativeTabs(CreativeTabs.getNextID(), "AllForFun's Tools") {
	@Override
	@SideOnly(Side.CLIENT)
	public Item getTabIconItem() {
	    return com.allforfunmc.refineddiamond.Code.MeltingPick;
	}
    };

    /**
     * Get drops of an ore
     * 
     * @param Item
     *            to drop
     * @param Fortune
     *            of pickaxe (6th param of getDrops)
     * @return List of items to drop.
     */
    public static final ArrayList<ItemStack> getOreDrops(Item itemDropped, int fortune) {
	ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
	drops.add(new ItemStack(itemDropped, 1));
	if (fortune >= 0 && Core.Random.nextBoolean()) {
	    drops.add(new ItemStack(itemDropped, 1));
	}
	if (fortune >= 2 && Random.nextBoolean()) {
	    drops.add(new ItemStack(itemDropped, 1));
	}
	if (fortune >= 3 && drops.size() < 3 && Random.nextBoolean()) {
	    drops.add(new ItemStack(itemDropped, 1));
	}
	return drops;
    }

    public static int NullID;
    public static Random Random = new Random();
}
@@ -632,12 +632,11 @@
 e = 
-fals
+tru
 e;%0A%09
@@ -679,16 +679,16 @@
 ssage)%7B%0A
-
 %09%09if(Cor
@@ -730,24 +730,272 @@
 ssage);%7D%0A%09%7D%0A
+%09public static void Debug(Exception Error)%7B%0A%09%09if(Core.DebugMode) %7B%0A%09%09System.out.println(%22=======Error=======%22);%0A%09%09System.out.println(Error.getMessage());%0A%09%09System.out.println(Error.getStackTrace());%7D%0A%09%09System.out.println(%22=======Error=======%22);%0A%09%7D%0A
     @Instanc

Debug w/ errors