OSDN Git Service

be67f7a745cf68ce05ca9dd4ea83612fed92b3c5
[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("C4096Si64"));
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.addReversibleOfPyrolysis(new ItemStack(Item.coal),
51                                 new Formula("C64"));
52
53                 this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(Block.oreCoal),
54                                 new Formula("C"));
55
56                 this.mod.api.addReversibleOfPyrolysis(new ItemStack(Item.ingotIron),
57                                 new Formula("Fe"));
58
59                 this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(Block.oreIron),
60                                 new Formula("Fe"));
61
62                 this.mod.api.addReversibleOfPyrolysis(new ItemStack(Block.blockSteel),
63                                 new Formula("9Fe"));
64
65                 this.mod.api.addReversibleOfPyrolysis(new ItemStack(Item.ingotGold),
66                                 new Formula("Au"));
67
68                 this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(Block.oreGold),
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                 this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(Block.oreEmerald),
93                                 new Formula("Be3Al2Si6O18"));
94
95
96
97                 //素材制作台のレシピ
98                 this.mod.api.addMaterialRecipe(
99                                 new ItemStack[] {
100                                                 null, new ItemStack(Block.stone), null,
101                                                 new ItemStack(Block.stone), new ItemStack(Item.gunpowder), new ItemStack(Block.stone),
102                                                 null, new ItemStack(Block.stone), null
103                                 },
104                                 new ItemStack(this.mod.itemAtomGrenade, 16, 0),
105                                 new NBTRecipeGrenade());
106
107                 this.mod.api.addSharplessMaterialRecipe(
108                                 new ItemStack[] {
109                                                 new ItemStack(this.mod.itemAtomGrenade, 1, 0),
110                                 },
111                                 new ItemStack(this.mod.itemAtomGrenade, 1, 0),
112                                 new NBTRecipeGrenade()
113                                 );
114
115                 ChemiCraftAPI.addMaterialRecipe(
116                                 new ItemStack[] {
117                                                 new ItemStack(Block.stone), new ItemStack(Item.ingotIron), new ItemStack(Block.stone),
118                                                 new ItemStack(Item.ingotIron), new ItemStack(ChemiCraftCore.instance.itemAtoms, 1, ChemiCraftData.URANIUM), new ItemStack(Item.ingotIron),
119                                                 new ItemStack(Block.stone), new ItemStack(Item.redstone), new ItemStack(Block.stone)
120                                 },
121                                 new ItemStack(this.mod.itemRadiationBallet),
122                                 null);
123
124                 ChemiCraftAPI.addMaterialRecipe(
125                                 new ItemStack[] {
126                                                 new ItemStack(Block.stone), new ItemStack(ChemiCraftCore.instance.itemAtoms, 1, ChemiCraftData.URANIUM), new ItemStack(Block.stone),
127                                                 new ItemStack(Item.ingotIron), new ItemStack(Item.redstone), new ItemStack(Item.ingotIron),
128                                                 new ItemStack(Block.stone), new ItemStack(Item.redstone), new ItemStack(Block.stone)
129                                 },
130                                 new ItemStack(this.mod.itemRaditionGunDataChip),
131                                 null);
132
133                 ChemiCraftAPI.addMaterialRecipe(
134                                 new ItemStack[]{
135                                                 new ItemStack(Block.blockSteel), new ItemStack(Block.blockSteel), new ItemStack(this.mod.itemRaditionGunDataChip),
136                                                 null, null, new ItemStack(Block.stone),
137                                                 null, null, new ItemStack(Item.stick)
138                                 },
139                                 new ItemStack(this.mod.itemRadiationGun),
140                                 null);
141
142                 //分解台のレシピ
143                 this.mod.api.addElectrolysisDecompositionRecipe(
144                                 new ItemStack(ChemiCraftCore.instance.itemCompounds, 1, this.mod.api.getCompound("Water")),
145                                 new Formula("H2O"));
146
147                 //鉱石分解の追加
148                 Iterator<String> arrayOreNames = this.mod.apiBase.getAtomOresFormulas().keySet().iterator();
149                 for (int i = 0; arrayOreNames.hasNext(); i++) {
150                         String name = arrayOreNames.next();
151                         ItemStack ingot;
152                         ItemStack ore;
153                         try {
154                                 ingot = OreDictionary.getOres("ingot" + name).get(0);
155                                 ore = OreDictionary.getOres("ore" + name).get(0);
156                         } catch (IndexOutOfBoundsException e) {
157                                 int var1 = this.mod.apiBase.getAtomOresAtomName().indexOf(name);
158                                 ingot = new ItemStack(this.mod.itemAtomIngots, 1, i);
159                                 ore = new ItemStack(this.mod.blockAtomOres[var1 / 16], 1, var1 % 16);
160                         }
161                         this.mod.api.addPyrolysisDecompositionRecipe(
162                                         ingot,
163                                         this.mod.apiBase.getAtomOresFormulas().get(name));
164                         this.mod.api.addPyrolysisDecompositionRecipe(
165                                         ore,
166                                         this.mod.apiBase.getAtomOresFormulas().get(name));
167                 }
168         }
169
170 }