aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java
blob: d62e472b0d42652ade9d1d313aa8e4e92f2d3290 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
package gtPlusPlus.xmod.gregtech.loaders;

import gregtech.api.util.GT_ModHandler;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.recipe.UtilsRecipe;
import net.minecraft.item.ItemStack;

public class RecipeGen_ShapedCrafting {

	public static void generateRecipes(Material material){
		Utils.LOG_INFO("Generating Shaped Crafting recipes for "+material.getLocalizedName()); //TODO
		
		//Plates
		
		//Single Plate Shaped/Shapeless
		GT_ModHandler.addCraftingRecipe(
				material.getPlate(1),
				gregtech.api.util.GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | gregtech.api.util.GT_ModHandler.RecipeBits.BUFFERED,
				new Object[]{"h", "B", "I",
						Character.valueOf('I'),
						material.getIngot(1),
						Character.valueOf('B'),
						material.getIngot(1)});

		GT_ModHandler.addShapelessCraftingRecipe(
				material.getPlate(1),
				new Object[]{gregtech.api.enums.ToolDictNames.craftingToolForgeHammer,
					material.getIngot(1),
					material.getIngot(1)});	     

		//Double Plate Shaped/Shapeless
		GT_ModHandler.addCraftingRecipe(
				material.getPlateDouble(1),
				gregtech.api.util.GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | gregtech.api.util.GT_ModHandler.RecipeBits.BUFFERED,
				new Object[]{"I", "B", "h",
						Character.valueOf('I'),
						material.getPlate(1),
						Character.valueOf('B'),
						material.getPlate(1)});
		
		GT_ModHandler.addShapelessCraftingRecipe(
				material.getPlateDouble(1),
				new Object[]{gregtech.api.enums.ToolDictNames.craftingToolForgeHammer,
					material.getPlate(1),
					material.getPlate(1)});	    
		
		//Ring Recipe
		if (!material.isRadioactive){
			if (UtilsRecipe.recipeBuilder(
					"craftingToolHardHammer", null, null,
					null, material.getRod(1), null,
					null, null, null,
					material.getRing(1))){
				Utils.LOG_INFO("Ring Recipe: "+material.getLocalizedName()+" - Success");
			}
			else {
				Utils.LOG_INFO("Ring Recipe: "+material.getLocalizedName()+" - Failed");			
			}
		}

		//Framebox Recipe
		if (!material.isRadioactive){
			ItemStack stackStick = material.getRod(1);
			if (UtilsRecipe.recipeBuilder(
					stackStick, stackStick, stackStick,
					stackStick, "craftingToolWrench", stackStick,
					stackStick, stackStick, stackStick,
					material.getFrameBox(2))){
				Utils.LOG_INFO("Framebox Recipe: "+material.getLocalizedName()+" - Success");
			}
			else {
				Utils.LOG_INFO("Framebox Recipe: "+material.getLocalizedName()+" - Failed");			
			}
		}

		//Shaped Recipe - Bolts
		if (!material.isRadioactive){
			if (UtilsRecipe.recipeBuilder(
					"craftingToolSaw", null, null,
					null, material.getRod(1), null,
					null, null, null,
					material.getBolt(2))){
				Utils.LOG_INFO("Bolt Recipe: "+material.getLocalizedName()+" - Success");
			}
			else {
				Utils.LOG_INFO("Bolt Recipe: "+material.getLocalizedName()+" - Failed");			
			}
		}


		//Shaped Recipe - Ingot to Rod
		if (UtilsRecipe.recipeBuilder(
				"craftingToolFile", null, null,
				null, material.getIngot(1), null,
				null, null, null,
				material.getRod(1))){
			Utils.LOG_INFO("Rod Recipe: "+material.getLocalizedName()+" - Success");
		}
		else {
			Utils.LOG_INFO("Rod Recipe: "+material.getLocalizedName()+" - Failed");			
		}


		//Shaped Recipe - Long Rod to two smalls
		if (UtilsRecipe.recipeBuilder(
				"craftingToolSaw", null, null,
				material.getLongRod(1), null, null,
				null, null, null,
				material.getRod(2))){
			Utils.LOG_INFO("Rod Recipe: "+material.getLocalizedName()+" - Success");
		}
		else {
			Utils.LOG_INFO("Rod Recipe: "+material.getLocalizedName()+" - Failed");			
		}

		//Two small to long rod
		if (UtilsRecipe.recipeBuilder(
				material.getRod(1), "craftingToolHardHammer", material.getRod(1),
				null, null, null,
				null, null, null,
				material.getLongRod(1))){
			Utils.LOG_INFO("Long Rod Recipe: "+material.getLocalizedName()+" - Success");
		}
		else {
			Utils.LOG_INFO("Long Rod Recipe: "+material.getLocalizedName()+" - Failed");			
		}

		//Rotor Recipe
		if (!material.isRadioactive){
			if (UtilsRecipe.recipeBuilder(
					material.getPlate(1), "craftingToolHardHammer", material.getPlate(1),
					material.getScrew(1), material.getRing(1), "craftingToolFile",
					material.getPlate(1), "craftingToolScrewdriver", material.getPlate(1),
					material.getRotor(1))){
				Utils.LOG_INFO("Rotor Recipe: "+material.getLocalizedName()+" - Success");
			}
			else {
				Utils.LOG_INFO("Rotor Recipe: "+material.getLocalizedName()+" - Failed");			
			}
		}

		//Screws
		if (!material.isRadioactive){
			if (UtilsRecipe.recipeBuilder(
					"craftingToolFile", material.getBolt(1), null,
					material.getBolt(1), null, null,
					null, null, null,
					material.getScrew(1))){
				Utils.LOG_INFO("Screw Recipe: "+material.getLocalizedName()+" - Success");
			}
			else {
				Utils.LOG_INFO("Screw Recipe: "+material.getLocalizedName()+" - Failed");			
			}
		}
	}
}