aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java174
1 files changed, 88 insertions, 86 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java
index 1646ab1535..79615d8457 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java
@@ -13,6 +13,7 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.material.MaterialGenerator;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.RecipeUtils;
public class RecipeGen_ShapedCrafting extends RecipeGen_Base {
@@ -21,7 +22,7 @@ public class RecipeGen_ShapedCrafting extends RecipeGen_Base {
static {
MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap);
}
-
+
public RecipeGen_ShapedCrafting(final Material M){
this.toGenerate = M;
mRecipeGenMap.add(this);
@@ -37,62 +38,63 @@ public class RecipeGen_ShapedCrafting extends RecipeGen_Base {
if (!CORE.GTNH) {
//Nuggets
- if (material.getNugget(1) != null)
- GT_ModHandler.addShapelessCraftingRecipe(
- material.getIngot(1),
- new Object[]{
- material.getNugget(1),
- material.getNugget(1),
- material.getNugget(1),
- material.getNugget(1),
- material.getNugget(1),
- material.getNugget(1),
- material.getNugget(1),
- material.getNugget(1),
- material.getNugget(1)
- });
+ if (ItemUtils.checkForInvalidItems(material.getNugget(1)) && ItemUtils.checkForInvalidItems(material.getIngot(1)))
+ GT_ModHandler.addShapelessCraftingRecipe(
+ material.getIngot(1),
+ new Object[]{
+ material.getNugget(1),
+ material.getNugget(1),
+ material.getNugget(1),
+ material.getNugget(1),
+ material.getNugget(1),
+ material.getNugget(1),
+ material.getNugget(1),
+ material.getNugget(1),
+ material.getNugget(1)
+ });
}
-
+
//Plates
-
+
//Single Plate Shaped/Shapeless
- if (material.getPlate(1) != null && material.getIngot(1) != null)
- 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)});
+ if (ItemUtils.checkForInvalidItems(material.getPlate(1)) && ItemUtils.checkForInvalidItems(material.getIngot(1)))
+ if (material.getPlate(1) != null && material.getIngot(1) != null)
+ 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)});
- if (material.getPlate(1) != null && material.getIngot(1) != null)
- GT_ModHandler.addShapelessCraftingRecipe(
- material.getPlate(1),
- new Object[]{gregtech.api.enums.ToolDictNames.craftingToolForgeHammer,
- material.getIngot(1),
- material.getIngot(1)});
+ if (ItemUtils.checkForInvalidItems(material.getPlate(1)) && ItemUtils.checkForInvalidItems(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
- if (material.getPlateDouble(1) != null && material.getPlate(1) != null)
- 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)});
+ if (ItemUtils.checkForInvalidItems(material.getPlateDouble(1)) && ItemUtils.checkForInvalidItems(material.getPlate(1)))
+ 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)});
- if (material.getPlateDouble(1) != null && material.getPlate(1) != null)
- GT_ModHandler.addShapelessCraftingRecipe(
- material.getPlateDouble(1),
- new Object[]{gregtech.api.enums.ToolDictNames.craftingToolForgeHammer,
- material.getPlate(1),
- material.getPlate(1)});
+ if (ItemUtils.checkForInvalidItems(material.getPlateDouble(1)) && ItemUtils.checkForInvalidItems(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 && material.getRing(1) != null && material.getRod(1) != null){
+ if (!material.isRadioactive && ItemUtils.checkForInvalidItems(material.getRing(1)) && ItemUtils.checkForInvalidItems(material.getRod(1))) {
if (CORE.GTNH){
if (RecipeUtils.recipeBuilder(
"craftingToolHardHammer", null, null,
@@ -121,7 +123,7 @@ public class RecipeGen_ShapedCrafting extends RecipeGen_Base {
//Framebox Recipe
- if (!material.isRadioactive && material.getFrameBox(1) != null && material.getRod(1) != null){
+ if (!material.isRadioactive && ItemUtils.checkForInvalidItems(material.getFrameBox(1)) && ItemUtils.checkForInvalidItems(material.getRod(1))) {
final ItemStack stackStick = material.getRod(1);
if (RecipeUtils.recipeBuilder(
stackStick, stackStick, stackStick,
@@ -166,7 +168,7 @@ public class RecipeGen_ShapedCrafting extends RecipeGen_Base {
//Shaped Recipe - Bolts
- if (!material.isRadioactive && material.getBolt(1) != null && material.getRod(1) != null){
+ if (!material.isRadioactive && ItemUtils.checkForInvalidItems(material.getBolt(1)) && ItemUtils.checkForInvalidItems(material.getRod(1))) {
if (RecipeUtils.recipeBuilder(
"craftingToolSaw", null, null,
null, material.getRod(1), null,
@@ -181,47 +183,47 @@ public class RecipeGen_ShapedCrafting extends RecipeGen_Base {
//Shaped Recipe - Ingot to Rod
- if (material.getRod(1) != null && material.getIngot(1) != null)
- if (RecipeUtils.recipeBuilder(
- "craftingToolFile", null, null,
- null, material.getIngot(1), null,
- null, null, null,
- material.getRod(1))){
- Logger.WARNING("Rod Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Rod Recipe: "+material.getLocalizedName()+" - Failed");
- }
+ if (ItemUtils.checkForInvalidItems(material.getRod(1)) && ItemUtils.checkForInvalidItems(material.getIngot(1)))
+ if (RecipeUtils.recipeBuilder(
+ "craftingToolFile", null, null,
+ null, material.getIngot(1), null,
+ null, null, null,
+ material.getRod(1))){
+ Logger.WARNING("Rod Recipe: "+material.getLocalizedName()+" - Success");
+ }
+ else {
+ Logger.WARNING("Rod Recipe: "+material.getLocalizedName()+" - Failed");
+ }
//Shaped Recipe - Long Rod to two smalls
- if (material.getRod(1) != null && material.getLongRod(1) != null)
- if (RecipeUtils.recipeBuilder(
- "craftingToolSaw", null, null,
- material.getLongRod(1), null, null,
- null, null, null,
- material.getRod(2))){
- Logger.WARNING("Rod Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Rod Recipe: "+material.getLocalizedName()+" - Failed");
- }
+ if (ItemUtils.checkForInvalidItems(material.getRod(1)) && ItemUtils.checkForInvalidItems(material.getLongRod(1)))
+ if (RecipeUtils.recipeBuilder(
+ "craftingToolSaw", null, null,
+ material.getLongRod(1), null, null,
+ null, null, null,
+ material.getRod(2))){
+ Logger.WARNING("Rod Recipe: "+material.getLocalizedName()+" - Success");
+ }
+ else {
+ Logger.WARNING("Rod Recipe: "+material.getLocalizedName()+" - Failed");
+ }
//Two small to long rod
- if (material.getLongRod(1) != null && material.getRod(1) != null)
- if (RecipeUtils.recipeBuilder(
- material.getRod(1), "craftingToolHardHammer", material.getRod(1),
- null, null, null,
- null, null, null,
- material.getLongRod(1))){
- Logger.WARNING("Long Rod Recipe: "+material.getLocalizedName()+" - Success");
- }
- else {
- Logger.WARNING("Long Rod Recipe: "+material.getLocalizedName()+" - Failed");
- }
+ if (ItemUtils.checkForInvalidItems(material.getLongRod(1)) && ItemUtils.checkForInvalidItems(material.getRod(1)))
+ if (RecipeUtils.recipeBuilder(
+ material.getRod(1), "craftingToolHardHammer", material.getRod(1),
+ null, null, null,
+ null, null, null,
+ material.getLongRod(1))){
+ Logger.WARNING("Long Rod Recipe: "+material.getLocalizedName()+" - Success");
+ }
+ else {
+ Logger.WARNING("Long Rod Recipe: "+material.getLocalizedName()+" - Failed");
+ }
//Rotor Recipe
- if (!material.isRadioactive && material.getRotor(1) != null && material.getRing(1) != null && material.getPlate(1) != null && material.getScrew(1) != null){
+ if (!material.isRadioactive && ItemUtils.checkForInvalidItems(material.getRotor(1)) && ItemUtils.checkForInvalidItems(material.getRing(1)) && !material.isRadioactive && ItemUtils.checkForInvalidItems(material.getPlate(1)) && ItemUtils.checkForInvalidItems(material.getScrew(1))) {
if (RecipeUtils.recipeBuilder(
material.getPlate(1), "craftingToolHardHammer", material.getPlate(1),
material.getScrew(1), material.getRing(1), "craftingToolFile",
@@ -235,7 +237,7 @@ public class RecipeGen_ShapedCrafting extends RecipeGen_Base {
}
//Gear Recipe
- if (!material.isRadioactive && material.getGear(1) != null && material.getPlate(1) != null && material.getRod(1) != null){
+ if (!material.isRadioactive && ItemUtils.checkForInvalidItems(material.getGear(1)) && ItemUtils.checkForInvalidItems(material.getPlate(1)) && ItemUtils.checkForInvalidItems(material.getRod(1))) {
if (RecipeUtils.recipeBuilder(
material.getRod(1), material.getPlate(1), material.getRod(1),
material.getPlate(1), "craftingToolWrench", material.getPlate(1),
@@ -249,7 +251,7 @@ public class RecipeGen_ShapedCrafting extends RecipeGen_Base {
}
//Screws
- if (!material.isRadioactive && material.getScrew(1) != null && material.getBolt(1) != null){
+ if (!material.isRadioactive && ItemUtils.checkForInvalidItems(material.getScrew(1)) && ItemUtils.checkForInvalidItems(material.getBolt(1))) {
if (RecipeUtils.recipeBuilder(
"craftingToolFile", material.getBolt(1), null,
material.getBolt(1), null, null,