OSDN Git Service

Merge branch 'master' of https://scm.sourceforge.jp/gitroot/chemicraft/chemicraft
[chemicraft/chemicraft.git] / common / pcc / chemicraft / base / ChemiCraftRegisterBaseRecipe.java
1 package pcc.chemicraft.base;
2
3 import java.util.Iterator;
4
5 import net.minecraft.block.Block;
6 import net.minecraft.item.Item;
7 import net.minecraft.item.ItemStack;
8 import net.minecraftforge.oredict.OreDictionary;
9 import pcc.chemicraft.ChemiCraftData;
10 import pcc.chemicraft.core.ChemiCraftAPI;
11 import pcc.chemicraft.core.ChemiCraftCore;
12 import pcc.chemicraft.core.nbt.NBTRecipeGrenade;
13 import pcc.chemicraft.util.Formula;
14
15 /**
16  * レシピを追加します
17  * @author mozipi,ponkotate
18  */
19 public class ChemiCraftRegisterBaseRecipe extends ChemiCraftBaseRegister {
20
21         public ChemiCraftRegisterBaseRecipe(ChemiCraftBase mod) {
22                 super(mod);
23         }
24
25         @Override
26         public void start() {
27
28                 //化合物のレシピ
29                 this.mod.api.addChemicalCombinationRecipe(
30                                 new ItemStack(ChemiCraftCore.instance.itemCompounds, 1, this.mod.api.getCompound("SodiumChloride")),
31                                 new Formula("NaOH"));
32
33                 this.mod.api.addChemicalCombinationRecipe(
34                                 new ItemStack(ChemiCraftCore.instance.itemCompounds, 1, this.mod.api.getCompound("ChlorousAcid")),
35                                 new Formula("HO2Cl"));
36
37                 //既存物のレシピ
38                 this.mod.api.addChemicalCombinationRecipe(new ItemStack(Item.diamond),
39                                 new Formula("C64Si16"));
40
41                 this.mod.api.addChemicalCombinationRecipe(new ItemStack(Item.sugar),
42                                 new Formula("C12H22O11"));
43
44                 this.mod.api.addReversibleOfElectrolysis(new ItemStack(Item.bucketWater),
45                                 new Formula("H2O"));
46
47                 this.mod.api.addReversibleOfElectrolysis(new ItemStack(Item.potion, 1, 0),
48                                 new Formula("H2O"));
49
50                 this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(Block.oreCoal),
51                                 new Formula("C"));
52
53                 this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(Item.coal),
54                                 new Formula("C"));
55
56                 this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(Block.oreIron),
57                                 new Formula("Fe"));
58
59                 this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(Item.ingotIron),
60                                 new Formula("Fe"));
61
62                 this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(Block.blockSteel),
63                                 new Formula("9Fe"));
64
65                 this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(Block.oreGold),
66                                 new Formula("Au"));
67
68                 this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(Item.ingotGold),
69                                 new Formula("Au"));
70
71                 this.mod.api.addReversibleOfPyrolysis(new ItemStack(Block.blockGold),
72                                 new Formula("9Au"));
73
74                 this.mod.api.addReversibleOfElectrolysis(new ItemStack(Block.wood),
75                                 new Formula("C6H10O5"));
76
77                 this.mod.api.addReversibleOfPyrolysis(new ItemStack(Block.dirt),
78                                 new Formula("SiI2O2"));
79
80                 this.mod.api.addReversibleOfPyrolysis(new ItemStack(Block.glass),
81                                 new Formula("SiCO2"));
82
83                 this.mod.api.addReversibleOfPyrolysis(new ItemStack(Block.stone),
84                                 new Formula("SiO2"));
85
86                 this.mod.api.addReversibleOfPyrolysis(new ItemStack(Block.tnt),
87                                 new Formula("C7H5N3O6"));
88
89                 this.mod.api.addReversibleOfPyrolysis(new ItemStack(Item.emerald),
90                                 new Formula("Be3Al2Si6O18"));
91
92
93                 //他MOD使用時のレシピ
94                 //RP2-------------------------------------------------------------------------------------------------------------
95                 this.mod.api.addPyrolysisDecompositionRecipe(
96                                 OreDictionary.getOres("oreCopper"), new Formula("Cu"));
97                 //------------------------------------------------------------------------------------------------------------------
98
99                 //素材制作台のレシピ
100                 this.mod.api.addMaterialRecipe(
101                                 new ItemStack[] {
102                                                 null, new ItemStack(Block.stone), null,
103                                                 new ItemStack(Block.stone), new ItemStack(Item.gunpowder), new ItemStack(Block.stone),
104                                                 null, new ItemStack(Block.stone), null
105                                 },
106                                 new ItemStack(this.mod.itemAtomGrenade, 16, 0),
107                                 new NBTRecipeGrenade());
108
109                 this.mod.api.addSharplessMaterialRecipe(
110                                 new ItemStack[] {
111                                                 new ItemStack(this.mod.itemAtomGrenade, 1, 0),
112                                 },
113                                 new ItemStack(this.mod.itemAtomGrenade, 1, 0),
114                                 new NBTRecipeGrenade()
115                                 );
116
117                 ChemiCraftAPI.addMaterialRecipe(
118                                 new ItemStack[] {
119                                                 new ItemStack(Block.stone), new ItemStack(Item.ingotIron), new ItemStack(Block.stone),
120                                                 new ItemStack(Item.ingotIron), new ItemStack(ChemiCraftCore.instance.itemAtoms, 1, ChemiCraftData.URANIUM), new ItemStack(Item.ingotIron),
121                                                 new ItemStack(Block.stone), new ItemStack(Item.redstone), new ItemStack(Block.stone)
122                                 },
123                                 new ItemStack(this.mod.itemRadiationBallet),
124                                 null);
125
126                 ChemiCraftAPI.addMaterialRecipe(
127                                 new ItemStack[] {
128                                                 new ItemStack(Block.stone), new ItemStack(ChemiCraftCore.instance.itemAtoms, 1, ChemiCraftData.URANIUM), new ItemStack(Block.stone),
129                                                 new ItemStack(Item.ingotIron), new ItemStack(Item.redstone), new ItemStack(Item.ingotIron),
130                                                 new ItemStack(Block.stone), new ItemStack(Item.redstone), new ItemStack(Block.stone)
131                                 },
132                                 new ItemStack(this.mod.itemRaditionGunDataChip),
133                                 null);
134
135                 ChemiCraftAPI.addMaterialRecipe(
136                                 new ItemStack[]{
137                                                 new ItemStack(Block.blockSteel), new ItemStack(Block.blockSteel), new ItemStack(this.mod.itemRaditionGunDataChip),
138                                                 null, null, new ItemStack(Block.stone),
139                                                 null, null, new ItemStack(Item.stick)
140                                 },
141                                 new ItemStack(this.mod.itemRadiationGun),
142                                 null);
143
144                 //分解台のレシピ
145                 this.mod.api.addElectrolysisDecompositionRecipe(
146                                 new ItemStack(ChemiCraftCore.instance.itemCompounds, 1, this.mod.api.getCompound("Water")),
147                                 new Formula("H2O"));
148
149                 //鉱石分解の追加
150                 Iterator<String> arrayOreNames = this.mod.apiBase.getAtomOresFormulas().keySet().iterator();
151                 for (int i = 0; arrayOreNames.hasNext(); i++) {
152                         String name = arrayOreNames.next();
153                         ItemStack ingot;
154                         ItemStack ore;
155                         try {
156                                 ingot = OreDictionary.getOres("ingot" + name).get(0);
157                                 ore = OreDictionary.getOres("ore" + name).get(0);
158                         } catch (IndexOutOfBoundsException e) {
159                                 int var1 = this.mod.apiBase.getAtomOresAtomName().indexOf(name);
160                                 ingot = new ItemStack(this.mod.itemAtomIngots, 1, i);
161                                 ore = new ItemStack(this.mod.blockAtomOres[var1 / 16], 1, var1 % 16);
162                         }
163                         this.mod.api.addPyrolysisDecompositionRecipe(
164                                         ingot,
165                                         this.mod.apiBase.getAtomOresFormulas().get(name));
166                         this.mod.api.addPyrolysisDecompositionRecipe(
167                                         ore,
168                                         this.mod.apiBase.getAtomOresFormulas().get(name));
169                 }
170         }
171
172 }