ActuallyAdditions/src/main/java/ellpeck/actuallyadditions/crafting/ItemCrafting.java

101 lines
4.8 KiB
Java
Raw Normal View History

2015-03-07 12:51:28 +01:00
package ellpeck.actuallyadditions.crafting;
import cpw.mods.fml.common.registry.GameRegistry;
2015-03-08 14:58:26 +01:00
import ellpeck.actuallyadditions.blocks.InitBlocks;
import ellpeck.actuallyadditions.blocks.metalists.TheMiscBlocks;
2015-03-07 12:51:28 +01:00
import ellpeck.actuallyadditions.config.ConfigValues;
import ellpeck.actuallyadditions.items.InitItems;
import ellpeck.actuallyadditions.items.metalists.TheDusts;
import ellpeck.actuallyadditions.items.metalists.TheMiscItems;
2015-03-29 16:07:43 +02:00
import ellpeck.actuallyadditions.items.metalists.TheSpecialDrops;
2015-03-07 12:51:28 +01:00
import ellpeck.actuallyadditions.util.Util;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
public class ItemCrafting{
public static void init(){
2015-03-29 15:29:05 +02:00
//Leaf Blower
if(ConfigValues.enableLeafBlowerRecipe)
GameRegistry.addRecipe(new ItemStack(InitItems.itemLeafBlower),
" F", "IP", "IR",
'F', new ItemStack(Items.flint),
'I', new ItemStack(Items.iron_ingot),
'P', new ItemStack(Blocks.piston),
'R', new ItemStack(Items.redstone));
2015-03-29 16:07:43 +02:00
//Ender Pearl
GameRegistry.addRecipe(new ItemStack(Items.ender_pearl),
"XXX", "XXX", "XXX",
'X', new ItemStack(InitItems.itemSpecialDrop, 1, TheSpecialDrops.PEARL_SHARD.ordinal()));
//Emerald
GameRegistry.addRecipe(new ItemStack(Items.emerald),
"XXX", "XXX", "XXX",
'X', new ItemStack(InitItems.itemSpecialDrop, 1, TheSpecialDrops.EMERALD_SHARD.ordinal()));
2015-03-29 15:29:05 +02:00
//Advanced Leaf Blower
if(ConfigValues.enableLeafBlowerAdvancedRecipe)
GameRegistry.addRecipe(new ItemStack(InitItems.itemLeafBlowerAdvanced),
" F", "DP", "DR",
'F', new ItemStack(Items.flint),
'D', new ItemStack(Items.diamond),
'P', new ItemStack(Blocks.piston),
'R', new ItemStack(Items.redstone));
2015-03-08 14:58:26 +01:00
//Quartz
if(ConfigValues.enabledMiscRecipes[TheMiscItems.QUARTZ.ordinal()])
GameRegistry.addSmelting(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ORE_QUARTZ.ordinal()),
new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), 1F);
//Knife
if(ConfigValues.enableKnifeRecipe)
GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemKnife),
new ItemStack(InitItems.itemMisc, 1, TheMiscItems.KNIFE_BLADE.ordinal()),
new ItemStack(InitItems.itemMisc, 1, TheMiscItems.KNIFE_HANDLE.ordinal()));
//Crafter on a Stick
if(ConfigValues.enableCrafterRecipe)
GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemCrafterOnAStick),
new ItemStack(Blocks.crafting_table),
new ItemStack(Items.sign),
new ItemStack(Items.slime_ball));
//Mashed Food
if(ConfigValues.enabledMiscRecipes[TheMiscItems.MASHED_FOOD.ordinal()])
initMashedFoodRecipes();
2015-03-08 14:58:26 +01:00
//Ingots from Dusts
GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.IRON.ordinal()),
2015-03-07 12:51:28 +01:00
new ItemStack(Items.iron_ingot), 1F);
2015-03-08 14:58:26 +01:00
GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.GOLD.ordinal()),
2015-03-07 12:51:28 +01:00
new ItemStack(Items.gold_ingot), 1F);
2015-03-08 14:58:26 +01:00
GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.DIAMOND.ordinal()),
2015-03-07 12:51:28 +01:00
new ItemStack(Items.diamond), 1F);
2015-03-08 14:58:26 +01:00
GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.EMERALD.ordinal()),
2015-03-07 12:51:28 +01:00
new ItemStack(Items.emerald), 1F);
2015-03-08 14:58:26 +01:00
GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.LAPIS.ordinal()),
2015-03-07 12:51:28 +01:00
new ItemStack(Items.dye, 1, 4), 1F);
2015-03-08 14:58:26 +01:00
GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.QUARTZ_BLACK.ordinal()),
new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), 1F);
GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.QUARTZ.ordinal()),
new ItemStack(Items.quartz), 1F);
GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.COAL.ordinal()),
new ItemStack(Items.coal), 1F);
2015-03-07 12:51:28 +01:00
}
public static void initMashedFoodRecipes(){
for(Object nextIterator : Item.itemRegistry){
if(nextIterator instanceof ItemFood){
ItemStack ingredient = new ItemStack((Item)nextIterator, 1, Util.WILDCARD);
2015-03-08 14:58:26 +01:00
GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemMisc, 8, TheMiscItems.MASHED_FOOD.ordinal()), ingredient, ingredient, ingredient, ingredient, new ItemStack(InitItems.itemKnife, 1, Util.WILDCARD));
}
}
}
}