OSDN Git Service

tc
[chemicraft/chemicraft.git] / common / pcc / chemicraft / ChemiCraftRegisterRecipe.java
1 package pcc.chemicraft;
2
3 import net.minecraft.block.Block;
4 import net.minecraft.item.Item;
5 import net.minecraft.item.ItemStack;
6 import pcc.chemicraft.util.Formula;
7 import pcc.chemicraft.util.NBTRecipeGrenade;
8 import cpw.mods.fml.common.registry.GameRegistry;
9
10 public class ChemiCraftRegisterRecipe extends ChemiCraftRegister {
11
12         public ChemiCraftRegisterRecipe(ChemiCraft mod) {
13                 super(mod);
14         }
15
16         @Override
17         public void start() {
18
19                 /*
20                  * 科学作業台のレシピ
21                  */
22                 GameRegistry.addRecipe(new ItemStack(this.mod.blockPyrolysisTable),
23                                 new Object[]{
24                         "XYX", "ZAZ", "ZZZ",
25                         Character.valueOf('X'), new ItemStack(Item.ingotIron),
26                         Character.valueOf('Y'), new ItemStack(Block.workbench),
27                         Character.valueOf('Z'), new ItemStack(Block.stone),
28                         Character.valueOf('A'), new ItemStack(Item.bucketLava),
29                 });
30
31                 GameRegistry.addRecipe(new ItemStack(this.mod.blockChemicalCombinationTable),
32                                 new Object[]{
33                         "XYX", "ZAZ", "ZZZ",
34                         Character.valueOf('X'), new ItemStack(Item.ingotIron),
35                         Character.valueOf('Y'), new ItemStack(Block.workbench),
36                         Character.valueOf('Z'), new ItemStack(Block.stone),
37                         Character.valueOf('A'), new ItemStack(Block.obsidian),
38                 });
39
40                 GameRegistry.addRecipe(new ItemStack(this.mod.blockToolAndWeaponCraftingTable),
41                                 new Object[]{
42                         "XYX", "ZAZ", "ZZZ",
43                         Character.valueOf('X'), new ItemStack(Item.ingotIron),
44                         Character.valueOf('Y'), new ItemStack(Block.workbench),
45                         Character.valueOf('Z'), new ItemStack(Block.stone),
46                         Character.valueOf('A'), new ItemStack(Item.pickaxeSteel),
47                 });
48
49                 GameRegistry.addRecipe(new ItemStack(this.mod.blockChemicalCraftingTable),
50                                 new Object[]{
51                         "XYX", "ZAZ", "ZZZ",
52                         Character.valueOf('X'), new ItemStack(Item.ingotIron),
53                         Character.valueOf('Y'), new ItemStack(Block.workbench),
54                         Character.valueOf('Z'), new ItemStack(Block.stone),
55                         Character.valueOf('A'), new ItemStack(this.mod.itemAtoms, 1, 0),
56                 });
57
58                 /*
59                  * 化合物のレシピ
60                  */
61                 this.mod.api.addChemicalCombinationRecipe(new ItemStack(this.mod.itemCompounds, 1, this.mod.api.getCompound("SodiumChloride")), new Formula(new String[]{"Na", "O", "H"}, new Integer[]{1, 1, 1}));
62                 this.mod.api.addChemicalCombinationRecipe(new ItemStack(this.mod.itemCompounds, 1, this.mod.api.getCompound("ChlorousAcid")), new Formula(new String[]{"H", "O", "Cl"}, new Integer[]{1, 2, 1}));
63                 this.mod.api.addReversibleOfElectrolysis(new ItemStack(this.mod.itemCompounds, 1, this.mod.api.getCompound("Water")), new Formula(new String[]{"H", "O"}, new Integer[]{2, 1}));
64
65                 /*
66                  * 既存物のレシピ
67                  */
68                 this.mod.api.addReversibleOfPyrolysis(new ItemStack(Block.dirt), new Formula("SiI2O2"));
69                 this.mod.api.addReversibleOfPyrolysis(new ItemStack(Block.sand), new Formula("SiIO"));
70                 this.mod.api.addReversibleOfPyrolysis(new ItemStack(Block.stone), new Formula("SiO2"));
71                 this.mod.api.addReversibleOfPyrolysis(new ItemStack(Block.glass), new Formula("SiCO2"));
72                 this.mod.api.addReversibleOfElectrolysis(new ItemStack(Block.wood), new Formula("C6H10O5"));
73                 this.mod.api.addReversibleOfPyrolysis(new ItemStack(Block.tnt), new Formula("C7H5N3O6"));
74                 this.mod.api.addReversibleOfPyrolysis(new ItemStack(Item.emerald), new Formula("Be3Al2Si6O18"));
75                 this.mod.api.addChemicalCombinationRecipe(new ItemStack(Item.diamond), new Formula("C64Si16"));
76
77                 /*
78                  * 素材制作代のレシピ
79                  */
80
81                 //化学電池の追加
82                 this.mod.api.addMaterialRecipe(new ItemStack[] {
83                                 null,
84                                 null,
85                                 null,
86                                 new ItemStack(this.mod.itemAtoms, 1, this.mod.chemicalData.ZINC),
87                                 null,
88                                 new ItemStack(this.mod.itemAtoms, 1, this.mod.chemicalData.COPPER),
89                                 new ItemStack(Item.bucketWater),
90                                 new ItemStack(Item.bucketWater),
91                                 new ItemStack(Item.bucketWater),
92                 },
93                 new ItemStack(this.mod.itemChemicalCells, 1, 0),
94                 null);
95
96                 //手榴弾の追加
97                 this.mod.api.addMaterialRecipe(new ItemStack[] {
98                                 null,
99                                 new ItemStack(Block.stone),
100                                 null,
101                                 new ItemStack(Block.stone),
102                                 new ItemStack(Item.gunpowder),
103                                 new ItemStack(Block.stone),
104                                 null,
105                                 new ItemStack(Block.stone),
106                                 null
107                 },
108                 new ItemStack(this.mod.itemAtomGrenade, 16, 0),
109                 new NBTRecipeGrenade()
110                                 );
111
112                 this.mod.api.addMaterialRecipe(new ItemStack[] {
113                                 new ItemStack(this.mod.itemAtoms, 1, ChemiCraftData.toAtoms("Na")),
114                                 new ItemStack(this.mod.itemAtoms, 1, ChemiCraftData.toAtoms("C")),
115                                 new ItemStack(this.mod.itemAtoms, 1, ChemiCraftData.toAtoms("I")),
116                                 null,
117                                 new ItemStack(Item.appleRed),
118                                 null,
119                                 null,
120                                 null,
121                                 null,
122                 }, 
123                 new ItemStack(this.mod.itemPear),
124                 null
125                                 );
126
127                 /*
128                  * 熱分解台のレシピ
129                  */
130                 this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(Item.potion, 1, 0),
131                                 new Integer[] {ChemiCraftData.HYDROGEN, this.mod.chemicalData.OXYGEN},
132                                 new Integer[] {2, 1});
133
134                 this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(this.mod.itemCompounds, 1, this.mod.api.getCompound("Water")),
135                                 new Integer[] {ChemiCraftData.HYDROGEN, this.mod.chemicalData.OXYGEN},
136                                 new Integer[] {2, 1});
137
138                 for (int i = 0; i < this.mod.api.getAtomOresName().sizeKeysList(); i++){
139                         this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(this.mod.blockAtomOres[i / 16], 1, i - i / 16 * 16),
140                                         this.mod.api.getAtomOresAtoms().get(this.mod.api.getAtomOresName().getKeyList(i)),
141                                         this.mod.api.getAtomOresAmounts().get(this.mod.api.getAtomOresName().getKeyList(i)));
142                 }
143
144
145         }
146
147 }