Finished basic recipes list, added another method for smelting recipes.
This commit is contained in:
parent
4982365ba2
commit
ccc59ddf85
|
@ -12,6 +12,7 @@ import ee3.item.ModItems;
|
|||
|
||||
import net.minecraft.src.Block;
|
||||
import net.minecraft.src.CraftingManager;
|
||||
import net.minecraft.src.FurnaceRecipes;
|
||||
import net.minecraft.src.IRecipe;
|
||||
import net.minecraft.src.Item;
|
||||
import net.minecraft.src.ItemStack;
|
||||
|
@ -25,14 +26,17 @@ public class RecipesPhilStone {
|
|||
|
||||
private static ItemStack anyCoal = new ItemStack(Item.coal, 1, -1);
|
||||
|
||||
private static ItemStack oakWood = new ItemStack(Block.wood, 1, 0);
|
||||
private static ItemStack birchWood = new ItemStack(Block.wood, 1, 1);
|
||||
private static ItemStack pineWood = new ItemStack(Block.wood, 1, 2);
|
||||
private static ItemStack jungleWood = new ItemStack(Block.wood, 1, 3);
|
||||
private static ItemStack anyWood = new ItemStack(Block.wood, 1, -1);
|
||||
|
||||
private static ItemStack planks(int i) { return new ItemStack(Block.planks, 1, i); }
|
||||
private static ItemStack wood(int i) { return new ItemStack(Block.wood, 1, i); }
|
||||
|
||||
private static ItemStack sandStone(int i) { return sandStone(1, i); }
|
||||
private static ItemStack sandStone(int i, int j) { return new ItemStack(Block.sandStone, i, j); }
|
||||
|
||||
private static ItemStack stoneBrick(int i) { return stoneBrick(1, i); }
|
||||
private static ItemStack stoneBrick(int i, int j) { return new ItemStack(Block.stoneBrick, i, j); }
|
||||
|
||||
private static ItemStack boneMeal = new ItemStack(Item.dyePowder, 1, 15);
|
||||
|
||||
public static void initRecipes() {
|
||||
|
@ -120,36 +124,41 @@ public class RecipesPhilStone {
|
|||
}
|
||||
}
|
||||
|
||||
/* Just use Item/Block and (optionally) meta-data for best results, when adding smelt-recipes.
|
||||
* Notice that this actually pulls results from the Furnace Recipes list, you could theoretically use this to pull
|
||||
* all possible results from a list and support their smelts automatically. */
|
||||
|
||||
/* No meta, defaults to zero */
|
||||
public static void addSmeltingRecipe(Object input) {
|
||||
addSmeltingRecipe(input, 0);
|
||||
}
|
||||
|
||||
/* Includes meta, passes either Block or Item, with meta, to final method as an ItemStack */
|
||||
public static void addSmeltingRecipe(Object input, int i) {
|
||||
if(input instanceof Item)
|
||||
addSmeltingRecipe(new ItemStack((Item)input, 1, i));
|
||||
else if (input instanceof Block)
|
||||
addSmeltingRecipe(new ItemStack((Block)input, 1, i));
|
||||
else
|
||||
return;
|
||||
}
|
||||
|
||||
/* Final method, actually adds the portable smelting recipe */
|
||||
public static void addSmeltingRecipe(ItemStack input) {
|
||||
ItemStack result = FurnaceRecipes.smelting().getSmeltingResult(input);
|
||||
if(result == null)
|
||||
return;
|
||||
Object[] list = new Object[9];
|
||||
list[0] = philStone;
|
||||
list[1] = anyCoal;
|
||||
for(int i = 2; i < 9; i++)
|
||||
list[i] = new ItemStack(input.getItem(), 1, input.getItemDamage());
|
||||
ModLoader.addShapelessRecipe(new ItemStack(result.getItem(), 7, result.getItemDamage()), list);
|
||||
}
|
||||
|
||||
|
||||
public static void initTransmutationRecipes() {
|
||||
/* Initialize meta-cycling recipes and other cycles first */
|
||||
|
||||
/* Wood Plank Cycle */
|
||||
addMetaCycleRecipe(Block.planks, 3);
|
||||
|
||||
/* Wood Log Cycle */
|
||||
addMetaCycleRecipe(Block.wood, 3);
|
||||
|
||||
/* Sapling Cycle */
|
||||
addMetaCycleRecipe(Block.sapling, 3);
|
||||
|
||||
/* Leaf Cycle */
|
||||
addMetaCycleRecipe(Block.leaves, 3);
|
||||
|
||||
/* Wool Cycle */
|
||||
addMetaCycleRecipe(Block.cloth, 15);
|
||||
|
||||
/* Dirt -> Cobble -> Sand -> Dirt */
|
||||
addOneWayRecipe(Block.dirt, 1, new ItemStack(Block.cobblestone, 1));
|
||||
addOneWayRecipe(Block.cobblestone, 1, new ItemStack(Block.sand, 1));
|
||||
addOneWayRecipe(Block.sand, 1, new ItemStack(Block.dirt, 1));
|
||||
|
||||
/* 2 Gravel -> 2 Flint -> 2 Sandstone -> 2 Gravel*/
|
||||
addOneWayRecipe(Block.gravel, 2, new ItemStack(Item.flint, 2));
|
||||
addOneWayRecipe(Item.flint, 2, new ItemStack(Block.sandStone, 2));
|
||||
addOneWayRecipe(Block.sandStone, 2, new ItemStack(Block.gravel, 2));
|
||||
|
||||
|
||||
public static void initTransmutationRecipes() {
|
||||
/* Initialize constructive/destructive recipes */
|
||||
|
||||
/* 4 Cobble <-> 1 Flint */
|
||||
|
@ -195,216 +204,109 @@ public class RecipesPhilStone {
|
|||
}
|
||||
|
||||
public static void initEquivalencyRecipes() {
|
||||
/* Dirt <-> Cobble <-> Sand Equivalence Recipes */
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Block.cobblestone, 1), new Object[] {
|
||||
philStone, Block.dirt
|
||||
});
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Block.sand, 1), new Object[] {
|
||||
philStone, Block.cobblestone
|
||||
});
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Block.dirt, 1), new Object[] {
|
||||
philStone, Block.sand
|
||||
});
|
||||
/* Initialize meta-cycling recipes and other cycles first */
|
||||
|
||||
/* Sapling Equivalence Recipes */
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Block.sapling, 1, 1), new Object[] {
|
||||
philStone, new ItemStack(Block.sapling, 1, 0)
|
||||
});
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Block.sapling, 1, 2), new Object[] {
|
||||
philStone, new ItemStack(Block.sapling, 1, 1)
|
||||
});
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Block.sapling, 1, 3), new Object[] {
|
||||
philStone, new ItemStack(Block.sapling, 1, 2)
|
||||
});
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Block.sapling, 1, 0), new Object[] {
|
||||
philStone, new ItemStack(Block.sapling, 1, 3)
|
||||
});
|
||||
/* Wood Plank Cycle */
|
||||
addMetaCycleRecipe(Block.planks, 3);
|
||||
|
||||
/* Leaf Equivalence Recipes */
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Block.leaves, 1, 1), new Object[] {
|
||||
philStone, new ItemStack(Block.leaves, 1, 0)
|
||||
});
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Block.leaves, 1, 2), new Object[] {
|
||||
philStone, new ItemStack(Block.leaves, 1, 1)
|
||||
});
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Block.leaves, 1, 3), new Object[] {
|
||||
philStone, new ItemStack(Block.leaves, 1, 2)
|
||||
});
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Block.leaves, 1, 0), new Object[] {
|
||||
philStone, new ItemStack(Block.leaves, 1, 3)
|
||||
});
|
||||
/* Wood Log Cycle */
|
||||
addMetaCycleRecipe(Block.wood, 3);
|
||||
|
||||
/* Wood Log Equivalence Recipes */
|
||||
ModLoader.addShapelessRecipe(birchWood, new Object[] {
|
||||
philStone, oakWood
|
||||
});
|
||||
ModLoader.addShapelessRecipe(pineWood, new Object[] {
|
||||
philStone, birchWood
|
||||
});
|
||||
ModLoader.addShapelessRecipe(jungleWood, new Object[] {
|
||||
philStone, pineWood
|
||||
});
|
||||
ModLoader.addShapelessRecipe(oakWood, new Object[] {
|
||||
philStone, jungleWood
|
||||
});
|
||||
/* Sapling Cycle */
|
||||
addMetaCycleRecipe(Block.sapling, 3);
|
||||
|
||||
/* Wood Plank Equivalence Recipes */
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Block.planks, 1, 1), new Object[] {
|
||||
philStone, new ItemStack(Block.planks, 1, 0)
|
||||
});
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Block.planks, 1, 2), new Object[] {
|
||||
philStone, new ItemStack(Block.planks, 1, 1)
|
||||
});
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Block.planks, 1, 3), new Object[] {
|
||||
philStone, new ItemStack(Block.planks, 1, 2)
|
||||
});
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Block.planks, 1, 0), new Object[] {
|
||||
philStone, new ItemStack(Block.planks, 1, 3)
|
||||
});
|
||||
/* Leaf Cycle */
|
||||
addMetaCycleRecipe(Block.leaves, 3);
|
||||
|
||||
/* Tallgrass Cycle */
|
||||
addMetaCycleRecipe(Block.tallGrass, 2);
|
||||
|
||||
/* Wool Cycle */
|
||||
addMetaCycleRecipe(Block.cloth, 15);
|
||||
|
||||
/* Dirt -> Cobble -> Sand -> Dirt */
|
||||
addOneWayRecipe(Block.dirt, 1, new ItemStack(Block.cobblestone, 1));
|
||||
addOneWayRecipe(Block.cobblestone, 1, new ItemStack(Block.sand, 1));
|
||||
addOneWayRecipe(Block.sand, 1, new ItemStack(Block.dirt, 1));
|
||||
|
||||
/* 2 Gravel -> 2 Flint -> 2 Sandstone (Cycles) -> 2 Gravel*/
|
||||
addOneWayRecipe(Block.gravel, 2, new ItemStack(Item.flint, 2));
|
||||
addOneWayRecipe(Item.flint, 2, sandStone(2, 0));
|
||||
addOneWayRecipe(sandStone(0), 2, sandStone(1));
|
||||
addOneWayRecipe(sandStone(1), 2, sandStone(2));
|
||||
addOneWayRecipe(sandStone(2), 2, new ItemStack(Block.gravel, 2));
|
||||
|
||||
/* Flower Equivalence Recipes */
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Block.plantRed, 1), new Object[] {
|
||||
philStone, Block.plantYellow
|
||||
});
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Block.plantYellow, 1), new Object[] {
|
||||
philStone, Block.plantRed
|
||||
});
|
||||
// RP2 flower recipe goes here
|
||||
addTwoWayRecipe(Block.plantYellow, 1, new ItemStack(Block.plantRed, 1));
|
||||
// RP2 flower recipe goes here, it SHOULD make them cycle instead of two-way if RP2 is present
|
||||
|
||||
/* Mushroom Equivalence Recipes */
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Block.mushroomBrown, 1), new Object[] {
|
||||
philStone, Block.mushroomRed
|
||||
});
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Block.mushroomRed, 1), new Object[] {
|
||||
philStone, Block.mushroomBrown
|
||||
});
|
||||
|
||||
/* Gravel <-> Sandstone <-> Fancy Sandstone I <-> Fancy Sandstone II Equivalence Recipes */
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Block.sandStone, 1, 0), new Object[] {
|
||||
philStone, new ItemStack(Block.gravel, 1)
|
||||
});
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Block.sandStone, 1, 1), new Object[] {
|
||||
philStone, new ItemStack(Block.sandStone, 1, 0)
|
||||
});
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Block.sandStone, 1, 2), new Object[] {
|
||||
philStone, new ItemStack(Block.sandStone, 1, 1)
|
||||
});
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Block.gravel, 1), new Object[] {
|
||||
philStone, new ItemStack(Block.sandStone, 1, 2)
|
||||
});
|
||||
addTwoWayRecipe(Block.mushroomBrown, 1, new ItemStack(Block.mushroomRed, 1));
|
||||
|
||||
/* Books/ */
|
||||
/* Reeds <-> Paper <-> Sugar Equivalence Recipes */
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Item.reed, 3), new Object[] {
|
||||
philStone, Item.paper, Item.paper, Item.paper
|
||||
});
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Item.reed, 1), new Object[] {
|
||||
philStone, Item.sugar
|
||||
});
|
||||
addOneWayRecipe(Item.book, 1, new ItemStack(Item.paper, 3));
|
||||
addOneWayRecipe(Item.paper, 3, new ItemStack(Item.reed, 3));
|
||||
addOneWayRecipe(Item.sugar, 1, new ItemStack(Item.reed, 1));
|
||||
|
||||
/* Melon <-> Pumpkin Equivalence Recipes */
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Item.pumpkinSeeds, 1), new Object[] {
|
||||
philStone, Item.melonSeeds
|
||||
});
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Item.melonSeeds, 1), new Object[] {
|
||||
philStone, Item.pumpkinSeeds
|
||||
});
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Block.pumpkin, 1), new Object[] {
|
||||
philStone, Block.melon
|
||||
});
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Block.melon, 1), new Object[] {
|
||||
philStone, Block.pumpkin
|
||||
});
|
||||
|
||||
/* Tall Grass Equivalence Recipes */
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Block.tallGrass, 1, 1), new Object[] {
|
||||
philStone, new ItemStack(Block.tallGrass, 1, 0)
|
||||
});
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Block.tallGrass, 1, 2), new Object[] {
|
||||
philStone, new ItemStack(Block.tallGrass, 1, 1)
|
||||
});
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Block.tallGrass, 1, 0), new Object[] {
|
||||
philStone, new ItemStack(Block.tallGrass, 1, 2)
|
||||
});
|
||||
addTwoWayRecipe(Item.pumpkinSeeds, 1, new ItemStack(Item.melonSeeds, 1));
|
||||
addTwoWayRecipe(Block.pumpkin, 1, new ItemStack(Block.melon, 1));
|
||||
}
|
||||
|
||||
public static void initReconstructiveRecipes() {
|
||||
/* 3 Bone Meal <-> 1 Bone */
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Item.bone, 1), new Object[] {
|
||||
philStone, boneMeal, boneMeal, boneMeal
|
||||
});
|
||||
addOneWayRecipe(boneMeal, 3, new ItemStack(Item.bone, 1));
|
||||
|
||||
/* 2 Blaze Powder <-> 1 Blaze Rod */
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Item.blazeRod, 1), new Object[] {
|
||||
philStone, Item.blazePowder, Item.blazePowder
|
||||
});
|
||||
addOneWayRecipe(Item.blazePowder, 2, new ItemStack(Item.blazeRod, 1));
|
||||
}
|
||||
|
||||
public static void initDestructorRecipes() {
|
||||
/* Clay Block -> 4 Clay Balls */
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Item.clay, 4), new Object[] {
|
||||
philStone, Block.blockClay
|
||||
});
|
||||
addOneWayRecipe(Block.blockClay, 1, new ItemStack(Item.clay, 4));
|
||||
|
||||
/* Smooth Stone -> Cobble Stone */
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Block.cobblestone, 1), new Object[] {
|
||||
philStone, Block.stone
|
||||
});
|
||||
addOneWayRecipe(Block.stone, 1, new ItemStack(Block.cobblestone, 1));
|
||||
|
||||
/* Glass -> Sand */
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Block.sand, 1), new Object[] {
|
||||
philStone, Block.glass
|
||||
});
|
||||
addOneWayRecipe(Block.glass, 1, new ItemStack(Block.sand, 1));
|
||||
|
||||
/* Glowstone Block -> 4 Glowstone Dust */
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Item.lightStoneDust, 4), new Object[] {
|
||||
philStone, Block.glowStone
|
||||
});
|
||||
addOneWayRecipe(Block.glowStone, 1, new ItemStack(Item.lightStoneDust, 4));
|
||||
|
||||
/* Brick Block -> 4 Bricks */
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Item.brick, 4), new Object[] {
|
||||
philStone, Block.brick
|
||||
});
|
||||
addOneWayRecipe(Block.brick, 1, new ItemStack(Item.brick, 4));
|
||||
}
|
||||
|
||||
public static void initPortableSmeltingRecipes() {
|
||||
/* 7 Cobble + 1 Coal|Charcoal = 7 Stone */
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Block.stone, 7), new Object[] {
|
||||
philStone, Block.cobblestone, Block.cobblestone, Block.cobblestone, Block.cobblestone, Block.cobblestone, Block.cobblestone, Block.cobblestone, anyCoal
|
||||
});
|
||||
/* Smelt cobblestone */
|
||||
addSmeltingRecipe(Block.cobblestone);
|
||||
|
||||
/* Smelt any wood */
|
||||
addSmeltingRecipe(anyWood);
|
||||
|
||||
/* Smelt iron ore */
|
||||
addSmeltingRecipe(Block.oreIron);
|
||||
|
||||
/* 7 Wood Logs + 1 Coal|Charcoal = 7 Charcoal */
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Item.coal, 7, 1), new Object[] {
|
||||
philStone, anyCoal, anyWood, anyWood, anyWood, anyWood, anyWood, anyWood, anyWood,
|
||||
});
|
||||
|
||||
/* Smelt gold ore */
|
||||
addSmeltingRecipe(Block.oreGold);
|
||||
|
||||
/* 7 Iron Ore + 1 Coal|Charcoal = 7 Iron Ingot */
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Item.ingotIron, 7), new Object[] {
|
||||
philStone, anyCoal, Block.oreIron, Block.oreIron, Block.oreIron, Block.oreIron, Block.oreIron, Block.oreIron, Block.oreIron
|
||||
});
|
||||
/* Smelt sand */
|
||||
addSmeltingRecipe(Block.sand);
|
||||
|
||||
/* 7 Gold Ore + 1 Coal|Charcoal = 7 Gold Ingot */
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Item.ingotGold, 7), new Object[] {
|
||||
philStone, anyCoal, Block.oreGold, Block.oreGold, Block.oreGold, Block.oreGold, Block.oreGold, Block.oreGold, Block.oreGold
|
||||
});
|
||||
|
||||
/* Cook chicken */
|
||||
addSmeltingRecipe(Item.chickenRaw);
|
||||
|
||||
/* 7 Sand + 1 Coal|Charcoal = 7 Glass */
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Block.glass, 7), new Object[] {
|
||||
philStone, anyCoal, Block.sand, Block.sand, Block.sand, Block.sand, Block.sand, Block.sand, Block.sand
|
||||
});
|
||||
/* Cook pork */
|
||||
addSmeltingRecipe(Item.porkRaw);
|
||||
|
||||
/* 7 Raw Chicken + 1 Coal|Charcoal = 7 Cooked Chicken */
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Item.chickenCooked, 7), new Object[] {
|
||||
philStone, anyCoal, Item.chickenRaw, Item.chickenRaw, Item.chickenRaw, Item.chickenRaw, Item.chickenRaw, Item.chickenRaw, Item.chickenRaw
|
||||
});
|
||||
/* Cook beef */
|
||||
addSmeltingRecipe(Item.beefRaw);
|
||||
|
||||
/* 7 Raw Pork + 1 Coal|Charcoal = 7 Cooked Pork */
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Item.porkCooked, 7), new Object[] {
|
||||
philStone, anyCoal, Item.porkRaw, Item.porkRaw, Item.porkRaw, Item.porkRaw, Item.porkRaw, Item.porkRaw, Item.porkRaw
|
||||
});
|
||||
|
||||
/* 7 Raw Beef + 1 Coal|Charcoal = 7 Cooked Pork */
|
||||
ModLoader.addShapelessRecipe(new ItemStack(Item.beefCooked, 7), new Object[] {
|
||||
philStone, anyCoal, Item.beefRaw, Item.beefRaw, Item.beefRaw, Item.beefRaw, Item.beefRaw, Item.beefRaw, Item.beefRaw
|
||||
});
|
||||
/* Cook fish */
|
||||
addSmeltingRecipe(Item.fishRaw);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue