2015-03-07 12:51:28 +01:00
|
|
|
package ellpeck.actuallyadditions.crafting;
|
2015-03-07 02:23:31 +01:00
|
|
|
|
|
|
|
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-04-24 19:22:03 +02:00
|
|
|
import ellpeck.actuallyadditions.config.values.ConfigCrafting;
|
2015-03-07 12:51:28 +01:00
|
|
|
import ellpeck.actuallyadditions.items.InitItems;
|
2015-05-20 22:39:43 +02:00
|
|
|
import ellpeck.actuallyadditions.items.metalists.*;
|
2015-06-12 19:12:06 +02:00
|
|
|
import ellpeck.actuallyadditions.util.INameableItem;
|
2015-03-07 12:51:28 +01:00
|
|
|
import ellpeck.actuallyadditions.util.Util;
|
2015-03-07 02:23:31 +01:00
|
|
|
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;
|
2015-04-04 05:20:19 +02:00
|
|
|
import net.minecraftforge.oredict.ShapedOreRecipe;
|
|
|
|
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
2015-03-07 02:23:31 +01:00
|
|
|
|
|
|
|
public class ItemCrafting{
|
|
|
|
|
|
|
|
public static void init(){
|
|
|
|
|
2015-05-20 22:39:43 +02:00
|
|
|
//Rice Stuff
|
|
|
|
if(ConfigCrafting.RICE_GADGETS.isEnabled()){
|
|
|
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.paper, 3),
|
|
|
|
"RRR",
|
|
|
|
'R', TheFoods.RICE.getOredictName()));
|
|
|
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemMisc, 4, TheMiscItems.RICE_SLIME.ordinal()),
|
|
|
|
" R ", "RBR", " R ",
|
|
|
|
'R', TheMiscItems.RICE_DOUGH.getOredictName(),
|
|
|
|
'B', Items.water_bucket));
|
|
|
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemMisc, 4, TheMiscItems.RICE_SLIME.ordinal()),
|
|
|
|
" R ", "RBR", " R ",
|
|
|
|
'R', TheMiscItems.RICE_DOUGH.getOredictName(),
|
|
|
|
'B', new ItemStack(Items.potionitem)));
|
|
|
|
}
|
|
|
|
|
2015-06-18 13:14:57 +02:00
|
|
|
//Leaf Blower
|
2015-04-24 19:22:03 +02:00
|
|
|
if(ConfigCrafting.LEAF_BLOWER.isEnabled())
|
2015-04-04 05:20:19 +02:00
|
|
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemLeafBlower),
|
2015-04-06 15:51:59 +02:00
|
|
|
" F", "IP", "IC",
|
2015-03-29 15:29:05 +02:00
|
|
|
'F', new ItemStack(Items.flint),
|
2015-04-04 05:20:19 +02:00
|
|
|
'I', "ingotIron",
|
2015-03-29 15:29:05 +02:00
|
|
|
'P', new ItemStack(Blocks.piston),
|
2015-04-06 15:51:59 +02:00
|
|
|
'C', TheMiscItems.COIL_ADVANCED.getOredictName()));
|
2015-04-04 05:20:19 +02:00
|
|
|
|
|
|
|
//Coil
|
2015-04-24 19:22:03 +02:00
|
|
|
if(ConfigCrafting.COIL.isEnabled())
|
2015-04-04 05:20:19 +02:00
|
|
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()),
|
|
|
|
" R ", "RIR", " R ",
|
|
|
|
'I', "ingotIron",
|
|
|
|
'R', "dustRedstone"));
|
|
|
|
|
2015-06-12 19:12:06 +02:00
|
|
|
//Cup
|
|
|
|
if(ConfigCrafting.CUP.isEnabled())
|
|
|
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CUP.ordinal()),
|
|
|
|
"S S", "SCS", "SSS",
|
|
|
|
'S', "stone",
|
|
|
|
'C', ((INameableItem)InitItems.itemCoffeeBean).getOredictName()));
|
|
|
|
|
|
|
|
//Paxels
|
|
|
|
if(ConfigCrafting.PAXELS.isEnabled()){
|
|
|
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.woodenPaxel),
|
|
|
|
new ItemStack(Items.wooden_axe),
|
|
|
|
new ItemStack(Items.wooden_pickaxe),
|
|
|
|
new ItemStack(Items.wooden_shovel),
|
|
|
|
new ItemStack(Items.wooden_sword),
|
|
|
|
new ItemStack(Items.wooden_hoe)));
|
|
|
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.stonePaxel),
|
|
|
|
new ItemStack(Items.stone_axe),
|
|
|
|
new ItemStack(Items.stone_pickaxe),
|
|
|
|
new ItemStack(Items.stone_shovel),
|
|
|
|
new ItemStack(Items.stone_sword),
|
|
|
|
new ItemStack(Items.stone_hoe)));
|
|
|
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.ironPaxel),
|
|
|
|
new ItemStack(Items.iron_axe),
|
|
|
|
new ItemStack(Items.iron_pickaxe),
|
|
|
|
new ItemStack(Items.iron_shovel),
|
|
|
|
new ItemStack(Items.iron_sword),
|
|
|
|
new ItemStack(Items.iron_hoe)));
|
|
|
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.goldPaxel),
|
|
|
|
new ItemStack(Items.golden_axe),
|
|
|
|
new ItemStack(Items.golden_pickaxe),
|
|
|
|
new ItemStack(Items.golden_shovel),
|
|
|
|
new ItemStack(Items.golden_sword),
|
|
|
|
new ItemStack(Items.golden_hoe)));
|
|
|
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.diamondPaxel),
|
|
|
|
new ItemStack(Items.diamond_axe),
|
|
|
|
new ItemStack(Items.diamond_pickaxe),
|
|
|
|
new ItemStack(Items.diamond_shovel),
|
|
|
|
new ItemStack(Items.diamond_sword),
|
|
|
|
new ItemStack(Items.diamond_hoe)));
|
|
|
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.emeraldPaxel),
|
|
|
|
new ItemStack(InitItems.itemAxeEmerald),
|
|
|
|
new ItemStack(InitItems.itemPickaxeEmerald),
|
|
|
|
new ItemStack(InitItems.itemSwordEmerald),
|
|
|
|
new ItemStack(InitItems.itemShovelEmerald),
|
|
|
|
new ItemStack(InitItems.itemHoeEmerald)));
|
|
|
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.obsidianPaxel),
|
|
|
|
new ItemStack(InitItems.itemAxeObsidian),
|
|
|
|
new ItemStack(InitItems.itemPickaxeObsidian),
|
|
|
|
new ItemStack(InitItems.itemSwordObsidian),
|
|
|
|
new ItemStack(InitItems.itemShovelObsidian),
|
|
|
|
new ItemStack(InitItems.itemHoeObsidian)));
|
|
|
|
}
|
|
|
|
|
2015-05-20 22:39:43 +02:00
|
|
|
//Resonant Rice
|
|
|
|
if(ConfigCrafting.RESONANT_RICE.isEnabled())
|
|
|
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemResonantRice),
|
|
|
|
TheFoods.RICE.getOredictName(), "nuggetEnderium", Items.gunpowder));
|
|
|
|
|
2015-04-04 05:20:19 +02:00
|
|
|
//Advanced Coil
|
2015-04-24 19:22:03 +02:00
|
|
|
if(ConfigCrafting.ADV_COIL.isEnabled())
|
2015-04-04 05:20:19 +02:00
|
|
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()),
|
|
|
|
" G ", "GCG", " G ",
|
|
|
|
'C', TheMiscItems.COIL.getOredictName(),
|
|
|
|
'G', "ingotGold"));
|
2015-03-29 15:29:05 +02:00
|
|
|
|
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
|
2015-04-24 19:22:03 +02:00
|
|
|
if(ConfigCrafting.LEAF_BLOWER_ADVANCED.isEnabled())
|
2015-04-04 05:20:19 +02:00
|
|
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemLeafBlowerAdvanced),
|
2015-04-06 15:51:59 +02:00
|
|
|
" F", "DP", "DC",
|
2015-03-29 15:29:05 +02:00
|
|
|
'F', new ItemStack(Items.flint),
|
2015-04-04 05:20:19 +02:00
|
|
|
'D', "gemDiamond",
|
2015-03-29 15:29:05 +02:00
|
|
|
'P', new ItemStack(Blocks.piston),
|
2015-04-06 15:51:59 +02:00
|
|
|
'C', TheMiscItems.COIL_ADVANCED.getOredictName()));
|
2015-03-29 15:29:05 +02:00
|
|
|
|
2015-05-20 22:39:43 +02:00
|
|
|
//Phantom Connector
|
|
|
|
if(ConfigCrafting.PHANTOM_CONNECTOR.isEnabled())
|
|
|
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemPhantomConnector),
|
|
|
|
"YE", "EY", "S ",
|
|
|
|
'Y', Items.ender_eye,
|
|
|
|
'E', Items.ender_pearl,
|
|
|
|
'S', "stickWood"));
|
|
|
|
|
2015-03-08 14:58:26 +01:00
|
|
|
//Quartz
|
2015-04-24 19:22:03 +02:00
|
|
|
GameRegistry.addSmelting(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ORE_QUARTZ.ordinal()),
|
|
|
|
new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), 1F);
|
2015-03-08 14:58:26 +01:00
|
|
|
|
2015-03-07 02:23:31 +01:00
|
|
|
//Knife
|
2015-04-24 19:22:03 +02:00
|
|
|
if(ConfigCrafting.KNIFE.isEnabled())
|
2015-04-04 05:20:19 +02:00
|
|
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemKnife),
|
|
|
|
TheMiscItems.KNIFE_BLADE.getOredictName(),
|
|
|
|
TheMiscItems.KNIFE_HANDLE.getOredictName()));
|
2015-03-07 02:23:31 +01:00
|
|
|
|
|
|
|
//Crafter on a Stick
|
2015-04-24 19:22:03 +02:00
|
|
|
if(ConfigCrafting.STICK_CRAFTER.isEnabled())
|
2015-03-07 02:23:31 +01:00
|
|
|
GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemCrafterOnAStick),
|
|
|
|
new ItemStack(Blocks.crafting_table),
|
|
|
|
new ItemStack(Items.sign),
|
|
|
|
new ItemStack(Items.slime_ball));
|
|
|
|
|
2015-05-20 22:39:43 +02:00
|
|
|
//Tiny Coal
|
|
|
|
GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemMisc, 8, TheMiscItems.TINY_COAL.ordinal()),
|
|
|
|
new ItemStack(Items.coal));
|
|
|
|
GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemMisc, 8, TheMiscItems.TINY_CHAR.ordinal()),
|
|
|
|
new ItemStack(Items.coal, 1, 1));
|
|
|
|
|
|
|
|
//Rice Seeds
|
|
|
|
GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemRiceSeed),
|
|
|
|
new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal()));
|
|
|
|
|
|
|
|
//Canola Seeds
|
|
|
|
GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemCanolaSeed),
|
|
|
|
new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CANOLA.ordinal()));
|
2015-04-24 19:22:03 +02:00
|
|
|
|
2015-03-07 02:23:31 +01:00
|
|
|
//Mashed Food
|
2015-04-24 19:22:03 +02:00
|
|
|
if(ConfigCrafting.MASHED_FOOD.isEnabled())
|
2015-03-07 02:23:31 +01:00
|
|
|
initMashedFoodRecipes();
|
|
|
|
|
2015-03-31 20:37:55 +02:00
|
|
|
//Rings
|
|
|
|
initPotionRingRecipes();
|
|
|
|
|
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
|
|
|
|
2015-03-07 02:23:31 +01:00
|
|
|
}
|
|
|
|
|
2015-03-31 20:37:55 +02:00
|
|
|
public static void initPotionRingRecipes(){
|
2015-04-04 05:20:19 +02:00
|
|
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.RING.ordinal()),
|
2015-03-31 20:37:55 +02:00
|
|
|
"IGI", "GDG", "IGI",
|
2015-04-04 05:20:19 +02:00
|
|
|
'G', "ingotGold",
|
|
|
|
'I', "ingotIron",
|
|
|
|
'D', "dustGlowstone"));
|
2015-03-31 20:37:55 +02:00
|
|
|
|
2015-04-24 19:22:03 +02:00
|
|
|
if(ConfigCrafting.RING_SPEED.isEnabled()) addRingRecipeWithStack(ThePotionRings.SPEED.craftingItem, ThePotionRings.SPEED.ordinal());
|
|
|
|
if(ConfigCrafting.RING_HASTE.isEnabled()) addRingRecipeWithStack(ThePotionRings.HASTE.craftingItem, ThePotionRings.HASTE.ordinal());
|
|
|
|
if(ConfigCrafting.RING_STRENGTH.isEnabled()) addRingRecipeWithStack(ThePotionRings.STRENGTH.craftingItem, ThePotionRings.STRENGTH.ordinal());
|
|
|
|
if(ConfigCrafting.RING_JUMP_BOOST.isEnabled()) addRingRecipeWithStack(ThePotionRings.JUMP_BOOST.craftingItem, ThePotionRings.JUMP_BOOST.ordinal());
|
|
|
|
if(ConfigCrafting.RING_REGEN.isEnabled()) addRingRecipeWithStack(ThePotionRings.REGEN.craftingItem, ThePotionRings.REGEN.ordinal());
|
|
|
|
if(ConfigCrafting.RING_RESISTANCE.isEnabled()) addRingRecipeWithStack(ThePotionRings.RESISTANCE.craftingItem, ThePotionRings.RESISTANCE.ordinal());
|
|
|
|
if(ConfigCrafting.RING_FIRE_RESISTANCE.isEnabled()) addRingRecipeWithStack(ThePotionRings.FIRE_RESISTANCE.craftingItem, ThePotionRings.FIRE_RESISTANCE.ordinal());
|
|
|
|
if(ConfigCrafting.RING_WATER_BREATHING.isEnabled()) addRingRecipeWithStack(ThePotionRings.WATER_BREATHING.craftingItem, ThePotionRings.WATER_BREATHING.ordinal());
|
|
|
|
if(ConfigCrafting.RING_INVISIBILITY.isEnabled()) addRingRecipeWithStack(ThePotionRings.INVISIBILITY.craftingItem, ThePotionRings.INVISIBILITY.ordinal());
|
|
|
|
if(ConfigCrafting.RING_NIGHT_VISION.isEnabled()) addRingRecipeWithStack(ThePotionRings.NIGHT_VISION.craftingItem, ThePotionRings.NIGHT_VISION.ordinal());
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void addRingRecipeWithStack(ItemStack mainStack, int meta){
|
|
|
|
GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemPotionRing, 1, meta), mainStack, mainStack, mainStack, mainStack, new ItemStack(Blocks.diamond_block), new ItemStack(Items.nether_wart), new ItemStack(Items.potionitem), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.RING.ordinal()));
|
2015-05-20 22:39:43 +02:00
|
|
|
GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemPotionRingAdvanced, 1, meta), new ItemStack(InitItems.itemPotionRing, 1, meta), new ItemStack(Items.nether_star), new ItemStack(Items.nether_star));
|
2015-03-31 20:37:55 +02:00
|
|
|
}
|
|
|
|
|
2015-03-07 02:23:31 +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-05-20 22:39:43 +02:00
|
|
|
GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemMisc, 12, TheMiscItems.MASHED_FOOD.ordinal()), ingredient, ingredient, ingredient, ingredient, new ItemStack(InitItems.itemKnife, 1, Util.WILDCARD));
|
2015-03-07 02:23:31 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|