OSDN Git Service

tc
[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                 this.mod.api.addChemicalCombinationRecipe(
29                                 new ItemStack(ChemiCraftCore.instance.itemCompounds, 1, this.mod.api.getCompound("SodiumChloride")),
30                                 new Formula("NaOH"));
31
32                 this.mod.api.addChemicalCombinationRecipe(
33                                 new ItemStack(ChemiCraftCore.instance.itemCompounds, 1, this.mod.api.getCompound("ChlorousAcid")),
34                                 new Formula("HO2Cl"));
35
36                 //既存物のレシピ
37                 this.mod.api.addChemicalCombinationRecipe(new ItemStack(Item.diamond),
38                                 new Formula("C64Si16"));
39
40                 this.mod.api.addChemicalCombinationRecipe(new ItemStack(Item.sugar),
41                                 new Formula("C12H22O11"));
42
43                 this.mod.api.addElectrolysisDecompositionRecipe(new ItemStack(Item.bucketWater),
44                                 new Formula("H2O"));
45
46                 this.mod.api.addElectrolysisDecompositionRecipe(new ItemStack(Item.potion, 1, 0),
47                                 new Formula("H2O"));
48
49                 this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(Block.oreCoal),
50                                 new Formula("C"));
51
52                 this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(Item.coal),
53                                 new Formula("C"));
54
55                 this.mod.api.addReversibleOfElectrolysis(new ItemStack(Block.wood),
56                                 new Formula("C6H10O5"));
57
58                 this.mod.api.addReversibleOfPyrolysis(new ItemStack(Block.dirt),
59                                 new Formula("SiI2O2"));
60
61                 this.mod.api.addReversibleOfPyrolysis(new ItemStack(Block.glass),
62                                 new Formula("SiCO2"));
63
64                 this.mod.api.addReversibleOfPyrolysis(new ItemStack(Block.stone),
65                                 new Formula("SiO2"));
66
67                 this.mod.api.addReversibleOfPyrolysis(new ItemStack(Block.tnt),
68                                 new Formula("C7H5N3O6"));
69
70                 this.mod.api.addReversibleOfPyrolysis(new ItemStack(Item.emerald),
71                                 new Formula("Be3Al2Si6O18"));
72
73
74                 //他MOD使用時のレシピ
75                 //RP2-------------------------------------------------------------------------------------------------------------
76                 this.mod.api.addPyrolysisDecompositionRecipe(
77                                 OreDictionary.getOres("oreCopper"), new Formula("Cu"));
78                 //------------------------------------------------------------------------------------------------------------------
79
80                 //素材制作台のレシピ
81                 this.mod.api.addMaterialRecipe(
82                                 new ItemStack[] {
83                                                 null, new ItemStack(Block.stone), null,
84                                                 new ItemStack(Block.stone), new ItemStack(Item.gunpowder), new ItemStack(Block.stone),
85                                                 null, new ItemStack(Block.stone), null
86                                 },
87                                 new ItemStack(this.mod.itemAtomGrenade, 16, 0),
88                                 new NBTRecipeGrenade());
89
90                 this.mod.api.addSharplessMaterialRecipe(
91                                 new ItemStack[] {
92                                                 new ItemStack(this.mod.itemAtomGrenade, 1, 0),
93                                 },
94                                 new ItemStack(this.mod.itemAtomGrenade, 1, 0),
95                                 new NBTRecipeGrenade()
96                                 );
97
98                 ChemiCraftAPI.addMaterialRecipe(
99                                 new ItemStack[] {
100                                                 new ItemStack(Block.stone), new ItemStack(Item.ingotIron), new ItemStack(Block.stone),
101                                                 new ItemStack(Item.ingotIron), new ItemStack(ChemiCraftCore.instance.itemAtoms, 1, ChemiCraftData.URANIUM), new ItemStack(Item.ingotIron),
102                                                 new ItemStack(Block.stone), new ItemStack(Item.redstone), new ItemStack(Block.stone)
103                                 },
104                                 new ItemStack(this.mod.itemRadiationBallet),
105                                 null);
106
107                 ChemiCraftAPI.addMaterialRecipe(
108                                 new ItemStack[] {
109                                                 new ItemStack(Block.stone), new ItemStack(ChemiCraftCore.instance.itemAtoms, 1, ChemiCraftData.URANIUM), new ItemStack(Block.stone),
110                                                 new ItemStack(Item.ingotIron), new ItemStack(Item.redstone), new ItemStack(Item.ingotIron),
111                                                 new ItemStack(Block.stone), new ItemStack(Item.redstone), new ItemStack(Block.stone)
112                                 },
113                                 new ItemStack(this.mod.itemRaditionGunDataChip),
114                                 null);
115
116                 ChemiCraftAPI.addMaterialRecipe(
117                                 new ItemStack[]{
118                                                 new ItemStack(Block.blockSteel), new ItemStack(Block.blockSteel), new ItemStack(this.mod.itemRaditionGunDataChip),
119                                                 null, null, new ItemStack(Block.stone),
120                                                 null, null, new ItemStack(Item.stick)
121                                 },
122                                 new ItemStack(this.mod.itemRadiationGun),
123                                 null);
124
125                 //分解台のレシピ
126                 this.mod.api.addElectrolysisDecompositionRecipe(
127                                 new ItemStack(ChemiCraftCore.instance.itemCompounds, 1, this.mod.api.getCompound("Water")),
128                                 new Formula("H2O"));
129
130                 //鉱石分解の追加
131                 Iterator<String> arrayOreNames = this.mod.apiBase.getAtomOresFormulas().keySet().iterator();
132                 while (arrayOreNames.hasNext()) {
133                         String name = arrayOreNames.next();
134                         ItemStack itemstack;
135                         try {
136                                         itemstack = OreDictionary.getOres(name).get(0);
137                         } catch (IndexOutOfBoundsException e) {
138                                 int var1 = this.mod.apiBase.getAtomOresAtomName().indexOf(name);
139                                 itemstack = new ItemStack(this.mod.blockAtomOres[var1 / 16], 1, var1 % 16);
140                         }
141                         this.mod.api.addPyrolysisDecompositionRecipe(
142                                         itemstack,
143                                         this.mod.apiBase.getAtomOresFormulas().get(name));
144                 }
145         }
146
147 }