<repo_name>Eragoneq/Lumium_Mod<file_sep>/java/com/eragon_skill/lumium/items/ExplosionRod.java
package com.eragon_skill.lumium.items;

import java.util.Set;

import com.eragon_skill.lumium.entities.EntityThrownTNT;
import com.google.common.collect.Sets;

import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemTool;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class ExplosionRod extends ItemTool{

	private static final Set SET = Sets.newHashSet(new Block[] {Blocks.air});
	
	public ExplosionRod(ToolMaterial material) {
		super(material, SET);
		this.setUnlocalizedName("explosion_rod");
		ItemStack stack = new ItemStack(ModItems.explosion_rod);
		this.setCreativeTab(CreativeTabs.tabCombat);
		GameRegistry.registerItem(this, "explosion_rod");
	}

	@Override
	public boolean onBlockDestroyed(ItemStack stack, World worldIn, IBlockState blockIn, BlockPos pos, EntityLivingBase entityLiving) {
		return false;
	}
	
	
	@Override
	public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) {
		world.playSound(player, player.getPosition(), SoundEvents.item_firecharge_use, SoundCategory.NEUTRAL, 0.7F, 0.9F);
		if(!world.isRemote){
			EntityThrownTNT eTT = new EntityThrownTNT(world, player);
			eTT.func_184538_a(player, player.rotationPitch, player.rotationYaw, 0.0F, 1.5F, 1.0F);
			world.spawnEntityInWorld(eTT);
			stack.damageItem(1, player);
		}
		return super.onItemRightClick(stack, world, player, hand);
	}
}
<file_sep>/java/com/eragon_skill/lumium/crafting/AltarCraftingManager.java
package com.eragon_skill.lumium.crafting;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Map;

import net.minecraft.block.Block;
import net.minecraft.block.BlockPlanks;
import net.minecraft.block.BlockStone;
import net.minecraft.block.BlockStoneSlab;
import net.minecraft.block.BlockStoneSlabNew;
import net.minecraft.block.BlockWall;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.RecipeBookCloning;
import net.minecraft.item.crafting.RecipeFireworks;
import net.minecraft.item.crafting.RecipeRepairItem;
import net.minecraft.item.crafting.RecipeTippedArrow;
import net.minecraft.item.crafting.RecipesArmor;
import net.minecraft.item.crafting.RecipesArmorDyes;
import net.minecraft.item.crafting.RecipesBanners;
import net.minecraft.item.crafting.RecipesCrafting;
import net.minecraft.item.crafting.RecipesDyes;
import net.minecraft.item.crafting.RecipesFood;
import net.minecraft.item.crafting.RecipesIngots;
import net.minecraft.item.crafting.RecipesMapCloning;
import net.minecraft.item.crafting.RecipesMapExtending;
import net.minecraft.item.crafting.RecipesTools;
import net.minecraft.item.crafting.RecipesWeapons;
import net.minecraft.item.crafting.ShapedRecipes;
import net.minecraft.item.crafting.ShapelessRecipes;
import net.minecraft.item.crafting.ShieldRecipes;
import net.minecraft.world.World;

import com.eragon_skill.lumium.items.ModItems;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;

public class AltarCraftingManager {
	/** The static instance of this class */
    private static final AltarCraftingManager instance = new AltarCraftingManager();
    private final List<IRecipe> recipes = Lists.<IRecipe>newArrayList();

    /**
     * Returns the static instance of this class
     */
    public static AltarCraftingManager getInstance()
    {
        /** The static instance of this class */
        return instance;
    }

    private AltarCraftingManager(){
    	this.addRecipe(new ItemStack(ModItems.explosion_rod), new Object[]{" IO", " RI", "R  ", 'I', ModItems.ignisium_ingot, 'R', Items.blaze_rod, 'O', Items.diamond});
        Collections.sort(this.recipes, new AltarCraftingComparator(this));
    } 
    public AltarShapedRecipes addRecipe(ItemStack stack, Object... recipeComponents)
    {
        String s = "";
        int i = 0;
        int j = 0;
        int k = 0;

        if (recipeComponents[i] instanceof String[])
        {
            String[] astring = (String[])((String[])recipeComponents[i++]);

            for (int l = 0; l < astring.length; ++l)
            {
                String s2 = astring[l];
                ++k;
                j = s2.length();
                s = s + s2;
            }
        }
        else
        {
            while (recipeComponents[i] instanceof String)
            {
                String s1 = (String)recipeComponents[i++];
                ++k;
                j = s1.length();
                s = s + s1;
            }
        }

        Map<Character, ItemStack> map;

        for (map = Maps.<Character, ItemStack>newHashMap(); i < recipeComponents.length; i += 2)
        {
            Character character = (Character)recipeComponents[i];
            ItemStack itemstack = null;

            if (recipeComponents[i + 1] instanceof Item)
            {
                itemstack = new ItemStack((Item)recipeComponents[i + 1]);
            }
            else if (recipeComponents[i + 1] instanceof Block)
            {
                itemstack = new ItemStack((Block)recipeComponents[i + 1], 1, 32767);
            }
            else if (recipeComponents[i + 1] instanceof ItemStack)
            {
                itemstack = (ItemStack)recipeComponents[i + 1];
            }

            map.put(character, itemstack);
        }

        ItemStack[] aitemstack = new ItemStack[j * k];

        for (int i1 = 0; i1 < j * k; ++i1)
        {
            char c0 = s.charAt(i1);

            if (map.containsKey(Character.valueOf(c0)))
            {
                aitemstack[i1] = ((ItemStack)map.get(Character.valueOf(c0))).copy();
            }
            else
            {
                aitemstack[i1] = null;
            }
        }

        AltarShapedRecipes shapedrecipes = new AltarShapedRecipes(j, k, aitemstack, stack);
        this.recipes.add(shapedrecipes);
        return shapedrecipes;
    }

    /**
     * Adds a shapeless crafting recipe to the the game.
     */
    public void addShapelessRecipe(ItemStack stack, Object... recipeComponents)
    {
        List<ItemStack> list = Lists.<ItemStack>newArrayList();

        for (Object object : recipeComponents)
        {
            if (object instanceof ItemStack)
            {
                list.add(((ItemStack)object).copy());
            }
            else if (object instanceof Item)
            {
                list.add(new ItemStack((Item)object));
            }
            else
            {
                if (!(object instanceof Block))
                {
                    throw new IllegalArgumentException("Invalid shapeless recipe: unknown type " + object.getClass().getName() + "!");
                }

                list.add(new ItemStack((Block)object));
            }
        }

        this.recipes.add(new AltarShapelessRecipes(stack, list));
    }

    /**
     * Adds an IRecipe to the list of crafting recipes.
     */
    public void addRecipe(IRecipe recipe)
    {
        this.recipes.add(recipe);
    }

    /**
     * Retrieves an ItemStack that has multiple recipes for it.
     */
    public ItemStack findMatchingRecipe(InventoryCrafting p_82787_1_, World worldIn)
    {
        for (IRecipe irecipe : this.recipes)
        {
            if (irecipe.matches(p_82787_1_, worldIn))
            {
                return irecipe.getCraftingResult(p_82787_1_);
            }
        }

        return null;
    }

    public ItemStack[] func_180303_b(InventoryCrafting p_180303_1_, World worldIn)
    {
        for (IRecipe irecipe : this.recipes)
        {
            if (irecipe.matches(p_180303_1_, worldIn))
            {
                return irecipe.getRemainingItems(p_180303_1_);
            }
        }

        ItemStack[] aitemstack = new ItemStack[p_180303_1_.getSizeInventory()];

        for (int i = 0; i < aitemstack.length; ++i)
        {
            aitemstack[i] = p_180303_1_.getStackInSlot(i);
        }

        return aitemstack;
    }

    public List<IRecipe> getRecipeList()
    {
        return this.recipes;
    }
}
<file_sep>/java/com/eragon_skill/lumium/blocks/ModBlocks.java
package com.eragon_skill.lumium.blocks;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;

import com.eragon_skill.lumium.LumiumMod;
import com.eragon_skill.lumium.utils.CustomBlock;
import com.eragon_skill.lumium.utils.CustomBlock.HarvestLevelEnum;
import com.eragon_skill.lumium.utils.CustomBlock.HarvestToolEnum;

public class ModBlocks {
	//Blocks
	public static CustomBlock lumium_ore;
	public static CustomBlock ignisium_ore;
	//
	public static CraftingAltar crafting_altar;
	public static final int guiIDCraftingAltar = 1;

	public static void initBlocks(){
		lumium_ore = new CustomBlock(Material.rock, "lumium_ore", 3.0F, 5.0F, HarvestToolEnum.PICKAXE, HarvestLevelEnum.IRON, CreativeTabs.tabBlock, 1, 3, 8, 15, 5, 60, new Block[]{Blocks.stone}, new Block[]{Blocks.lava, Blocks.diamond_ore}, 3, true, false, false);
		ignisium_ore = new CustomBlock(Material.rock, "ignisium_ore", 7.0F, 10.0F, HarvestToolEnum.PICKAXE, HarvestLevelEnum.LUMIUM, CreativeTabs.tabBlock, 1, 3, 4, 100, 0, 255, new Block[]{Blocks.netherrack}, new Block[]{Blocks.netherrack}, 0, false, true, false);
		crafting_altar = new CraftingAltar();
	}
}
<file_sep>/java/com/eragon_skill/lumium/items/ItemModPickaxe.java
package com.eragon_skill.lumium.items;

import java.util.List;

import com.eragon_skill.lumium.Reference;

import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemPickaxe;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class ItemModPickaxe extends ItemPickaxe{

	public ItemModPickaxe(ToolMaterial material, String name) {
		super(material);
		this.setUnlocalizedName(name);
		this.setCreativeTab(CreativeTabs.tabTools);	
		GameRegistry.registerItem(this, name);
	}
	
	public void RegisterRenderer(String modelName)
	{
		Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(this, 0, new ModelResourceLocation(Reference.MOD_ID+":"+modelName, "inventory"));
	}
	
}
<file_sep>/java/com/eragon_skill/lumium/entities/ModEntities.java
package com.eragon_skill.lumium.entities;

import net.minecraft.entity.EntityList;
import net.minecraftforge.fml.common.registry.EntityRegistry;

import com.eragon_skill.lumium.LumiumMod;

public class ModEntities {
	
	public static EntityThrownTNT thrown_tnt;
	
	public static void initEntities(){
		createEntity(EntityThrownTNT.class, "thrown_tnt");
	}
	
	public static void createEntity(Class classId, String name){
		int id = EntityRegistry.findGlobalUniqueEntityId();
		EntityRegistry.registerGlobalEntityID(classId, name, id);
		EntityRegistry.registerModEntity(classId, name, id, LumiumMod.instance, 80, 10, true);
	}
	
	public static void createEntity(Class classId, String name, int solidColor, int spotColor){
		int id = EntityRegistry.findGlobalUniqueEntityId();
		EntityRegistry.registerGlobalEntityID(classId, name, id);
		EntityRegistry.registerModEntity(classId, name, id, LumiumMod.instance, 80, 10, true);
		EntityRegistry.registerEgg(classId, solidColor, spotColor);
	}
}
<file_sep>/java/com/eragon_skill/lumium/inventory/InventoryCoreSlot.java
package com.eragon_skill.lumium.inventory;

import com.eragon_skill.lumium.items.ModItems;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ItemStackHelper;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextComponentTranslation;

public class InventoryCoreSlot implements IInventory{
	
	private ItemStack[] stackCore = new ItemStack[1];
	
	@Override
	public String getName() {
		return "Player Core Slot";
	}

	@Override
	public boolean hasCustomName() {
		return false;
	}

	@Override
	public ITextComponent getDisplayName() {
		return (ITextComponent)(this.hasCustomName() ? new TextComponentString(this.getName()) : new TextComponentTranslation(this.getName(), new Object[0]));
	}

	@Override
	public int getSizeInventory() {
		return 1;
	}

	@Override
	public ItemStack getStackInSlot(int index) {
		return this.stackCore[0];
	}

	@Override
	public ItemStack decrStackSize(int index, int count) {
		return ItemStackHelper.func_188383_a(this.stackCore, 0);
	}

	@Override
	public ItemStack removeStackFromSlot(int index) {
        return ItemStackHelper.func_188383_a(this.stackCore, 0);
	}

	@Override
	public void setInventorySlotContents(int index, ItemStack stack) {
		this.stackCore[0] = stack;
	}

	@Override
	public int getInventoryStackLimit() {
		return 1;
	}

	@Override
	public void markDirty() {
	}

	@Override
	public boolean isUseableByPlayer(EntityPlayer player) {
		return true;
	}

	@Override
	public void openInventory(EntityPlayer player) {	
	}

	@Override
	public void closeInventory(EntityPlayer player) {
	}

	@Override
	public boolean isItemValidForSlot(int index, ItemStack stack) {
		return false;
	}

	@Override
	public int getField(int id) {
		return 0;
	}

	@Override
	public void setField(int id, int value) {	
	}

	@Override
	public int getFieldCount() {
		return 0;
	}

	@Override
	public void clear() {
		this.stackCore[0]=null;
	}
}
<file_sep>/java/com/eragon_skill/lumium/items/ItemModShovel.java
package com.eragon_skill.lumium.items;

import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemSpade;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraftforge.fml.common.registry.GameRegistry;

import com.eragon_skill.lumium.Reference;

public class ItemModShovel extends ItemSpade{
	
	public ItemModShovel(ToolMaterial material, String name) {
		super(material);
		this.setUnlocalizedName(name);
		this.setCreativeTab(CreativeTabs.tabTools);	
		GameRegistry.registerItem(this, name);
	}
}
<file_sep>/java/com/eragon_skill/lumium/proxy/CommonProxy.java
package com.eragon_skill.lumium.proxy;

import com.eragon_skill.lumium.LumiumMod;
import com.eragon_skill.lumium.blocks.ModBlocks;
import com.eragon_skill.lumium.entities.ModEntities;
import com.eragon_skill.lumium.handlers.CraftingHandler;
import com.eragon_skill.lumium.items.ModItems;
import com.eragon_skill.lumium.utils.CustomBlock;
import com.eragon_skill.lumium.utils.CustomItem;
import com.eragon_skill.lumium.utils.CustomBlock.HarvestLevelEnum;
import com.eragon_skill.lumium.utils.CustomBlock.HarvestToolEnum;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;

public class CommonProxy 
{
	public void preInit(FMLPreInitializationEvent e)
	{
		
	}
	
	public void init(FMLInitializationEvent e)
	{
		ModItems.initItems();
		ModBlocks.initBlocks();
		ModEntities.initEntities();
		CraftingHandler.registerCraftingRecipes();
		CraftingHandler.registerSmeltingRecipes();
	}
	
	public void postInit(FMLPostInitializationEvent e)
	{
		
	}
}
<file_sep>/java/com/eragon_skill/lumium/renderers/ModBlockRenderer.java
package com.eragon_skill.lumium.renderers;

import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;

import com.eragon_skill.lumium.Reference;
import com.eragon_skill.lumium.blocks.ModBlocks;

public class ModBlockRenderer {
	
	public static void registerBlockRenderers(){
		reg(ModBlocks.ignisium_ore);
		reg(ModBlocks.lumium_ore);
		reg(ModBlocks.crafting_altar);
	}
	public static void reg(Block block)
	{
		Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(block), 0, new ModelResourceLocation(Reference.MOD_ID+":"+block.getUnlocalizedName().substring(5), "inventory"));
	}
}
