diff --git a/src/main/java/micdoodle8/mods/galacticraft/core/client/jei/tier1rocket/Tier1RocketRecipeMaker.java b/src/main/java/micdoodle8/mods/galacticraft/core/client/jei/tier1rocket/Tier1RocketRecipeMaker.java index d36352df33..6f49c607a9 100644 --- a/src/main/java/micdoodle8/mods/galacticraft/core/client/jei/tier1rocket/Tier1RocketRecipeMaker.java +++ b/src/main/java/micdoodle8/mods/galacticraft/core/client/jei/tier1rocket/Tier1RocketRecipeMaker.java @@ -4,6 +4,8 @@ import micdoodle8.mods.galacticraft.api.recipe.INasaWorkbenchRecipe; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; +import net.minecraft.util.NonNullList; +import net.minecraftforge.oredict.OreDictionary; import java.util.ArrayList; import java.util.List; @@ -31,11 +33,14 @@ public static List getRecipesList() public static int countChests(INasaWorkbenchRecipe recipe) { int count = 0; - ItemStack chest = new ItemStack(Blocks.CHEST); - for (Entry e : recipe.getRecipeInput().entrySet()) + NonNullList woodChests = OreDictionary.getOres("chestWood"); + for (ItemStack woodChest : woodChests) { - if (ItemStack.areItemsEqual(chest, e.getValue())) - count++; + for (Entry e : recipe.getRecipeInput().entrySet()) + { + if (ItemStack.areItemsEqual(woodChest, e.getValue())) + count++; + } } return count; } diff --git a/src/main/java/micdoodle8/mods/galacticraft/core/inventory/ContainerSchematicTier1Rocket.java b/src/main/java/micdoodle8/mods/galacticraft/core/inventory/ContainerSchematicTier1Rocket.java index fddc76fa03..3ecce49463 100644 --- a/src/main/java/micdoodle8/mods/galacticraft/core/inventory/ContainerSchematicTier1Rocket.java +++ b/src/main/java/micdoodle8/mods/galacticraft/core/inventory/ContainerSchematicTier1Rocket.java @@ -13,6 +13,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.oredict.OreDictionary; public class ContainerSchematicTier1Rocket extends Container { @@ -164,25 +165,37 @@ else if (var2.getItem() == GCItems.rocketEngine) return ItemStack.EMPTY; } } - else if (var2.getItem() == Item.getItemFromBlock(Blocks.CHEST)) + else { - if (!this.mergeOneItem(var4, 15, 18, false)) + boolean foundChest = false; + for (ItemStack woodChest : OreDictionary.getOres("chestWood")) { - return ItemStack.EMPTY; + if (var2.getItem() == woodChest.getItem()) + { + foundChest = true; + break; + } } - } - else if (par1 >= 18 && par1 < 45) - { - if (!this.mergeItemStack(var4, 45, 54, false)) + if (foundChest) { - return ItemStack.EMPTY; + if (!this.mergeOneItem(var4, 15, 18, false)) + { + return ItemStack.EMPTY; + } } - } - else if (par1 >= 45 && par1 < 54) - { - if (!this.mergeItemStack(var4, 18, 45, false)) + else if (par1 >= 18 && par1 < 45) { - return ItemStack.EMPTY; + if (!this.mergeItemStack(var4, 45, 54, false)) + { + return ItemStack.EMPTY; + } + } + else if (par1 >= 45 && par1 < 54) + { + if (!this.mergeItemStack(var4, 18, 45, false)) + { + return ItemStack.EMPTY; + } } } diff --git a/src/main/java/micdoodle8/mods/galacticraft/core/recipe/RecipeManagerGC.java b/src/main/java/micdoodle8/mods/galacticraft/core/recipe/RecipeManagerGC.java index 8503e8c057..9e4889523e 100644 --- a/src/main/java/micdoodle8/mods/galacticraft/core/recipe/RecipeManagerGC.java +++ b/src/main/java/micdoodle8/mods/galacticraft/core/recipe/RecipeManagerGC.java @@ -32,6 +32,7 @@ import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.item.crafting.IRecipe; +import net.minecraft.util.NonNullList; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.RecipeSorter; @@ -126,47 +127,55 @@ public static void addUniversalRecipes() input.put(17, ItemStack.EMPTY); RecipeUtil.addRocketBenchRecipe(new ItemStack(GCItems.rocketTier1, 1, 0), input); - HashMap input2 = new HashMap(input); - input2.put(15, new ItemStack(Blocks.CHEST)); - input2.put(16, ItemStack.EMPTY); - input2.put(17, ItemStack.EMPTY); - RecipeUtil.addRocketBenchRecipe(new ItemStack(GCItems.rocketTier1, 1, 1), input2); - - input2 = new HashMap(input); - input2.put(15, ItemStack.EMPTY); - input2.put(16, new ItemStack(Blocks.CHEST)); - input2.put(17, ItemStack.EMPTY); - RecipeUtil.addRocketBenchRecipe(new ItemStack(GCItems.rocketTier1, 1, 1), input2); - - input2 = new HashMap(input); - input2.put(15, ItemStack.EMPTY); - input2.put(16, ItemStack.EMPTY); - input2.put(17, new ItemStack(Blocks.CHEST)); - RecipeUtil.addRocketBenchRecipe(new ItemStack(GCItems.rocketTier1, 1, 1), input2); - - input2 = new HashMap(input); - input2.put(15, new ItemStack(Blocks.CHEST)); - input2.put(16, new ItemStack(Blocks.CHEST)); - input2.put(17, ItemStack.EMPTY); - RecipeUtil.addRocketBenchRecipe(new ItemStack(GCItems.rocketTier1, 1, 2), input2); + NonNullList woodChests = OreDictionary.getOres("chestWood"); + HashMap input2; - input2 = new HashMap(input); - input2.put(15, new ItemStack(Blocks.CHEST)); - input2.put(16, ItemStack.EMPTY); - input2.put(17, new ItemStack(Blocks.CHEST)); - RecipeUtil.addRocketBenchRecipe(new ItemStack(GCItems.rocketTier1, 1, 2), input2); + for (ItemStack woodChest : woodChests) + { + input2 = new HashMap(input); + input2.put(15, woodChest); + input2.put(16, ItemStack.EMPTY); + input2.put(17, ItemStack.EMPTY); + RecipeUtil.addRocketBenchRecipe(new ItemStack(GCItems.rocketTier1, 1, 1), input2); + + input2 = new HashMap(input); + input2.put(15, ItemStack.EMPTY); + input2.put(16, woodChest); + input2.put(17, ItemStack.EMPTY); + RecipeUtil.addRocketBenchRecipe(new ItemStack(GCItems.rocketTier1, 1, 1), input2); + + input2 = new HashMap(input); + input2.put(15, ItemStack.EMPTY); + input2.put(16, ItemStack.EMPTY); + input2.put(17, woodChest); + RecipeUtil.addRocketBenchRecipe(new ItemStack(GCItems.rocketTier1, 1, 1), input2); + + input2 = new HashMap(input); + input2.put(15, woodChest); + input2.put(16, woodChest); + input2.put(17, ItemStack.EMPTY); + RecipeUtil.addRocketBenchRecipe(new ItemStack(GCItems.rocketTier1, 1, 2), input2); + + input2 = new HashMap(input); + input2.put(15, woodChest); + input2.put(16, ItemStack.EMPTY); + input2.put(17, woodChest); + RecipeUtil.addRocketBenchRecipe(new ItemStack(GCItems.rocketTier1, 1, 2), input2); + + input2 = new HashMap(input); + input2.put(15, ItemStack.EMPTY); + input2.put(16, woodChest); + input2.put(17, woodChest); + RecipeUtil.addRocketBenchRecipe(new ItemStack(GCItems.rocketTier1, 1, 2), input2); + + input2 = new HashMap(input); + input2.put(15, woodChest); + input2.put(16, woodChest); + input2.put(17, woodChest); + RecipeUtil.addRocketBenchRecipe(new ItemStack(GCItems.rocketTier1, 1, 3), input2); + } - input2 = new HashMap(input); - input2.put(15, ItemStack.EMPTY); - input2.put(16, new ItemStack(Blocks.CHEST)); - input2.put(17, new ItemStack(Blocks.CHEST)); - RecipeUtil.addRocketBenchRecipe(new ItemStack(GCItems.rocketTier1, 1, 2), input2); - input2 = new HashMap(input); - input2.put(15, new ItemStack(Blocks.CHEST)); - input2.put(16, new ItemStack(Blocks.CHEST)); - input2.put(17, new ItemStack(Blocks.CHEST)); - RecipeUtil.addRocketBenchRecipe(new ItemStack(GCItems.rocketTier1, 1, 3), input2); // diff --git a/src/main/java/micdoodle8/mods/galacticraft/planets/asteroids/inventory/ContainerSchematicTier3Rocket.java b/src/main/java/micdoodle8/mods/galacticraft/planets/asteroids/inventory/ContainerSchematicTier3Rocket.java index dcd5d8ee59..4897150c8d 100644 --- a/src/main/java/micdoodle8/mods/galacticraft/planets/asteroids/inventory/ContainerSchematicTier3Rocket.java +++ b/src/main/java/micdoodle8/mods/galacticraft/planets/asteroids/inventory/ContainerSchematicTier3Rocket.java @@ -13,6 +13,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.oredict.OreDictionary; public class ContainerSchematicTier3Rocket extends Container { @@ -153,7 +154,16 @@ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par1) } else { - if (var2.getItem() == Item.getItemFromBlock(Blocks.CHEST)) + boolean foundChest = false; + for (ItemStack woodChest : OreDictionary.getOres("chestWood")) + { + if (var2.getItem() == woodChest.getItem()) + { + foundChest = true; + break; + } + } + if (foundChest) { if (!this.mergeOneItemTestValid(var4, 19, 22, false)) { diff --git a/src/main/java/micdoodle8/mods/galacticraft/planets/asteroids/recipe/RecipeManagerAsteroids.java b/src/main/java/micdoodle8/mods/galacticraft/planets/asteroids/recipe/RecipeManagerAsteroids.java index b9ce9e000b..5ba9b5dec6 100644 --- a/src/main/java/micdoodle8/mods/galacticraft/planets/asteroids/recipe/RecipeManagerAsteroids.java +++ b/src/main/java/micdoodle8/mods/galacticraft/planets/asteroids/recipe/RecipeManagerAsteroids.java @@ -15,6 +15,7 @@ import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.item.crafting.Ingredient; import net.minecraft.util.NonNullList; +import net.minecraftforge.oredict.OreDictionary; import java.util.HashMap; @@ -74,64 +75,73 @@ public static void addUniversalRecipes() input.put(21, ItemStack.EMPTY); GalacticraftRegistry.addT3RocketRecipe(new NasaWorkbenchRecipe(new ItemStack(AsteroidsItems.tier3Rocket, 1, 0), input)); - HashMap input2 = new HashMap(input); - input2.put(19, new ItemStack(Blocks.CHEST)); - input2.put(20, ItemStack.EMPTY); - input2.put(21, ItemStack.EMPTY); - GalacticraftRegistry.addT3RocketRecipe(new NasaWorkbenchRecipe(new ItemStack(AsteroidsItems.tier3Rocket, 1, 1), input2)); + NonNullList woodChests = OreDictionary.getOres("chestWood"); + HashMap input2; - input2 = new HashMap(input); - input2.put(19, ItemStack.EMPTY); - input2.put(20, new ItemStack(Blocks.CHEST)); - input2.put(21, ItemStack.EMPTY); - GalacticraftRegistry.addT3RocketRecipe(new NasaWorkbenchRecipe(new ItemStack(AsteroidsItems.tier3Rocket, 1, 1), input2)); + for (ItemStack woodChest : woodChests) + { + input2 = new HashMap(input); + input2.put(19, woodChest); + input2.put(20, ItemStack.EMPTY); + input2.put(21, ItemStack.EMPTY); + GalacticraftRegistry.addT3RocketRecipe(new NasaWorkbenchRecipe(new ItemStack(AsteroidsItems.tier3Rocket, 1, 1), input2)); + + input2 = new HashMap(input); + input2.put(19, ItemStack.EMPTY); + input2.put(20, woodChest); + input2.put(21, ItemStack.EMPTY); + GalacticraftRegistry.addT3RocketRecipe(new NasaWorkbenchRecipe(new ItemStack(AsteroidsItems.tier3Rocket, 1, 1), input2)); - input2 = new HashMap(input); - input2.put(19, ItemStack.EMPTY); - input2.put(20, ItemStack.EMPTY); - input2.put(21, new ItemStack(Blocks.CHEST)); - GalacticraftRegistry.addT3RocketRecipe(new NasaWorkbenchRecipe(new ItemStack(AsteroidsItems.tier3Rocket, 1, 1), input2)); + input2 = new HashMap(input); + input2.put(19, ItemStack.EMPTY); + input2.put(20, ItemStack.EMPTY); + input2.put(21, woodChest); + GalacticraftRegistry.addT3RocketRecipe(new NasaWorkbenchRecipe(new ItemStack(AsteroidsItems.tier3Rocket, 1, 1), input2)); - input2 = new HashMap(input); - input2.put(19, new ItemStack(Blocks.CHEST)); - input2.put(20, new ItemStack(Blocks.CHEST)); - input2.put(21, ItemStack.EMPTY); - GalacticraftRegistry.addT3RocketRecipe(new NasaWorkbenchRecipe(new ItemStack(AsteroidsItems.tier3Rocket, 1, 2), input2)); + input2 = new HashMap(input); + input2.put(19, woodChest); + input2.put(20, woodChest); + input2.put(21, ItemStack.EMPTY); + GalacticraftRegistry.addT3RocketRecipe(new NasaWorkbenchRecipe(new ItemStack(AsteroidsItems.tier3Rocket, 1, 2), input2)); - input2 = new HashMap(input); - input2.put(19, new ItemStack(Blocks.CHEST)); - input2.put(20, ItemStack.EMPTY); - input2.put(21, new ItemStack(Blocks.CHEST)); - GalacticraftRegistry.addT3RocketRecipe(new NasaWorkbenchRecipe(new ItemStack(AsteroidsItems.tier3Rocket, 1, 2), input2)); + input2 = new HashMap(input); + input2.put(19, woodChest); + input2.put(20, ItemStack.EMPTY); + input2.put(21, woodChest); + GalacticraftRegistry.addT3RocketRecipe(new NasaWorkbenchRecipe(new ItemStack(AsteroidsItems.tier3Rocket, 1, 2), input2)); - input2 = new HashMap(input); - input2.put(19, ItemStack.EMPTY); - input2.put(20, new ItemStack(Blocks.CHEST)); - input2.put(21, new ItemStack(Blocks.CHEST)); - GalacticraftRegistry.addT3RocketRecipe(new NasaWorkbenchRecipe(new ItemStack(AsteroidsItems.tier3Rocket, 1, 2), input2)); + input2 = new HashMap(input); + input2.put(19, ItemStack.EMPTY); + input2.put(20, woodChest); + input2.put(21, woodChest); + GalacticraftRegistry.addT3RocketRecipe(new NasaWorkbenchRecipe(new ItemStack(AsteroidsItems.tier3Rocket, 1, 2), input2)); - input2 = new HashMap(input); - input2.put(19, new ItemStack(Blocks.CHEST)); - input2.put(20, new ItemStack(Blocks.CHEST)); - input2.put(21, new ItemStack(Blocks.CHEST)); - GalacticraftRegistry.addT3RocketRecipe(new NasaWorkbenchRecipe(new ItemStack(AsteroidsItems.tier3Rocket, 1, 3), input2)); + input2 = new HashMap(input); + input2.put(19, woodChest); + input2.put(20, woodChest); + input2.put(21, woodChest); + GalacticraftRegistry.addT3RocketRecipe(new NasaWorkbenchRecipe(new ItemStack(AsteroidsItems.tier3Rocket, 1, 3), input2)); + } - input = new HashMap(); - input.put(1, new ItemStack(GCItems.heavyPlatingTier1)); - input.put(3, new ItemStack(GCItems.heavyPlatingTier1)); - input.put(5, new ItemStack(GCItems.heavyPlatingTier1)); - input.put(11, new ItemStack(GCItems.heavyPlatingTier1)); - input.put(2, new ItemStack(AsteroidsItems.orionDrive)); - input.put(4, new ItemStack(AsteroidsItems.orionDrive)); - input.put(9, new ItemStack(AsteroidsItems.orionDrive)); - input.put(10, new ItemStack(AsteroidsItems.orionDrive)); - input.put(12, new ItemStack(AsteroidsItems.orionDrive)); - input.put(6, new ItemStack(GCItems.basicItem, 1, 14)); - input.put(7, new ItemStack(Blocks.CHEST)); - input.put(8, new ItemStack(Blocks.CHEST)); - input.put(13, new ItemStack(AsteroidsItems.basicItem, 1, 8)); - input.put(14, new ItemStack(GCItems.flagPole)); - GalacticraftRegistry.addAstroMinerRecipe(new NasaWorkbenchRecipe(new ItemStack(AsteroidsItems.astroMiner, 1, 0), input)); + for (ItemStack woodChest : woodChests) + { + input = new HashMap(); + input.put(1, new ItemStack(GCItems.heavyPlatingTier1)); + input.put(3, new ItemStack(GCItems.heavyPlatingTier1)); + input.put(5, new ItemStack(GCItems.heavyPlatingTier1)); + input.put(11, new ItemStack(GCItems.heavyPlatingTier1)); + input.put(2, new ItemStack(AsteroidsItems.orionDrive)); + input.put(4, new ItemStack(AsteroidsItems.orionDrive)); + input.put(9, new ItemStack(AsteroidsItems.orionDrive)); + input.put(10, new ItemStack(AsteroidsItems.orionDrive)); + input.put(12, new ItemStack(AsteroidsItems.orionDrive)); + input.put(6, new ItemStack(GCItems.basicItem, 1, 14)); + input.put(7, woodChest); + input.put(8, woodChest); + input.put(13, new ItemStack(AsteroidsItems.basicItem, 1, 8)); + input.put(14, new ItemStack(GCItems.flagPole)); + GalacticraftRegistry.addAstroMinerRecipe(new NasaWorkbenchRecipe(new ItemStack(AsteroidsItems.astroMiner, 1, 0), input)); + } //All this is for NEI's benefit NonNullList list1 = NonNullList.create(); diff --git a/src/main/java/micdoodle8/mods/galacticraft/planets/mars/inventory/ContainerSchematicTier2Rocket.java b/src/main/java/micdoodle8/mods/galacticraft/planets/mars/inventory/ContainerSchematicTier2Rocket.java index 6de2422a85..b37ba4b346 100644 --- a/src/main/java/micdoodle8/mods/galacticraft/planets/mars/inventory/ContainerSchematicTier2Rocket.java +++ b/src/main/java/micdoodle8/mods/galacticraft/planets/mars/inventory/ContainerSchematicTier2Rocket.java @@ -13,6 +13,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import net.minecraftforge.oredict.OreDictionary; public class ContainerSchematicTier2Rocket extends Container { @@ -153,25 +154,37 @@ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par1) if (!done) { - if (var2.getItem() == Item.getItemFromBlock(Blocks.CHEST) && !((Slot) this.inventorySlots.get(19)).getHasStack()) + boolean foundChest = false; + for (ItemStack woodChest : OreDictionary.getOres("chestWood")) { - if (!this.mergeOneItem(var4, 19, 20, false)) + if (var2.getItem() == woodChest.getItem()) { - return ItemStack.EMPTY; + foundChest = true; + break; } } - else if (var2.getItem() == Item.getItemFromBlock(Blocks.CHEST) && !((Slot) this.inventorySlots.get(20)).getHasStack()) + if (foundChest) { - if (!this.mergeOneItem(var4, 20, 21, false)) + if (!((Slot) this.inventorySlots.get(19)).getHasStack()) { - return ItemStack.EMPTY; + if (!this.mergeOneItem(var4, 19, 20, false)) + { + return ItemStack.EMPTY; + } } - } - else if (var2.getItem() == Item.getItemFromBlock(Blocks.CHEST) && !((Slot) this.inventorySlots.get(21)).getHasStack()) - { - if (!this.mergeOneItem(var4, 21, 22, false)) + else if (!((Slot) this.inventorySlots.get(20)).getHasStack()) { - return ItemStack.EMPTY; + if (!this.mergeOneItem(var4, 20, 21, false)) + { + return ItemStack.EMPTY; + } + } + else if (!((Slot) this.inventorySlots.get(21)).getHasStack()) + { + if (!this.mergeOneItem(var4, 21, 22, false)) + { + return ItemStack.EMPTY; + } } } else if (par1 >= 22 && par1 < 49) diff --git a/src/main/java/micdoodle8/mods/galacticraft/planets/mars/recipe/RecipeManagerMars.java b/src/main/java/micdoodle8/mods/galacticraft/planets/mars/recipe/RecipeManagerMars.java index 3323f45794..ceb46417a8 100644 --- a/src/main/java/micdoodle8/mods/galacticraft/planets/mars/recipe/RecipeManagerMars.java +++ b/src/main/java/micdoodle8/mods/galacticraft/planets/mars/recipe/RecipeManagerMars.java @@ -9,6 +9,7 @@ import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraft.util.NonNullList; import net.minecraftforge.oredict.OreDictionary; import java.util.HashMap; @@ -37,7 +38,7 @@ public static void addUniversalRecipes() FurnaceRecipes.instance().addSmeltingRecipeForBlock(Blocks.PLANKS, new ItemStack(MarsItems.carbonFragments), 0.0F); // Schematic - HashMap input = new HashMap(); + HashMap input = new HashMap<>(); input.put(1, new ItemStack(GCItems.partNoseCone)); input.put(2, new ItemStack(MarsItems.marsItemBasic, 1, 3)); input.put(3, new ItemStack(MarsItems.marsItemBasic, 1, 3)); @@ -61,51 +62,58 @@ public static void addUniversalRecipes() input.put(21, ItemStack.EMPTY); MarsUtil.addRocketBenchT2Recipe(new ItemStack(MarsItems.rocketMars, 1, 0), input); - HashMap input2 = new HashMap(input); - input2.put(19, new ItemStack(Blocks.CHEST)); - input2.put(20, ItemStack.EMPTY); - input2.put(21, ItemStack.EMPTY); - MarsUtil.addRocketBenchT2Recipe(new ItemStack(MarsItems.rocketMars, 1, 1), input2); - - input2 = new HashMap(input); - input2.put(19, ItemStack.EMPTY); - input2.put(20, new ItemStack(Blocks.CHEST)); - input2.put(21, ItemStack.EMPTY); - MarsUtil.addRocketBenchT2Recipe(new ItemStack(MarsItems.rocketMars, 1, 1), input2); - - input2 = new HashMap(input); - input2.put(19, ItemStack.EMPTY); - input2.put(20, ItemStack.EMPTY); - input2.put(21, new ItemStack(Blocks.CHEST)); - MarsUtil.addRocketBenchT2Recipe(new ItemStack(MarsItems.rocketMars, 1, 1), input2); - - input2 = new HashMap(input); - input2.put(19, new ItemStack(Blocks.CHEST)); - input2.put(20, new ItemStack(Blocks.CHEST)); - input2.put(21, ItemStack.EMPTY); - MarsUtil.addRocketBenchT2Recipe(new ItemStack(MarsItems.rocketMars, 1, 2), input2); - - input2 = new HashMap(input); - input2.put(19, new ItemStack(Blocks.CHEST)); - input2.put(20, ItemStack.EMPTY); - input2.put(21, new ItemStack(Blocks.CHEST)); - MarsUtil.addRocketBenchT2Recipe(new ItemStack(MarsItems.rocketMars, 1, 2), input2); - - input2 = new HashMap(input); - input2.put(19, ItemStack.EMPTY); - input2.put(20, new ItemStack(Blocks.CHEST)); - input2.put(21, new ItemStack(Blocks.CHEST)); - MarsUtil.addRocketBenchT2Recipe(new ItemStack(MarsItems.rocketMars, 1, 2), input2); - - input2 = new HashMap(input); - input2.put(19, new ItemStack(Blocks.CHEST)); - input2.put(20, new ItemStack(Blocks.CHEST)); - input2.put(21, new ItemStack(Blocks.CHEST)); - MarsUtil.addRocketBenchT2Recipe(new ItemStack(MarsItems.rocketMars, 1, 3), input2); + NonNullList woodChests = OreDictionary.getOres("chestWood"); + HashMap input2; + + for (ItemStack woodChest : woodChests) + { + input2 = new HashMap<>(input); + input2.put(19, woodChest); + input2.put(20, ItemStack.EMPTY); + input2.put(21, ItemStack.EMPTY); + MarsUtil.addRocketBenchT2Recipe(new ItemStack(MarsItems.rocketMars, 1, 1), input2); + + input2 = new HashMap<>(input); + input2.put(19, ItemStack.EMPTY); + input2.put(20, woodChest); + input2.put(21, ItemStack.EMPTY); + MarsUtil.addRocketBenchT2Recipe(new ItemStack(MarsItems.rocketMars, 1, 1), input2); + + input2 = new HashMap<>(input); + input2.put(19, ItemStack.EMPTY); + input2.put(20, ItemStack.EMPTY); + input2.put(21, woodChest); + MarsUtil.addRocketBenchT2Recipe(new ItemStack(MarsItems.rocketMars, 1, 1), input2); + + input2 = new HashMap<>(input); + input2.put(19, woodChest); + input2.put(20, woodChest); + input2.put(21, ItemStack.EMPTY); + MarsUtil.addRocketBenchT2Recipe(new ItemStack(MarsItems.rocketMars, 1, 2), input2); + + input2 = new HashMap<>(input); + input2.put(19, woodChest); + input2.put(20, ItemStack.EMPTY); + input2.put(21, woodChest); + MarsUtil.addRocketBenchT2Recipe(new ItemStack(MarsItems.rocketMars, 1, 2), input2); + + input2 = new HashMap<>(input); + input2.put(19, ItemStack.EMPTY); + input2.put(20, woodChest); + input2.put(21, woodChest); + MarsUtil.addRocketBenchT2Recipe(new ItemStack(MarsItems.rocketMars, 1, 2), input2); + + input2 = new HashMap<>(input); + input2.put(19, woodChest); + input2.put(20, woodChest); + input2.put(21, woodChest); + MarsUtil.addRocketBenchT2Recipe(new ItemStack(MarsItems.rocketMars, 1, 3), input2); + } + // - input = new HashMap(); + input = new HashMap<>(); input.put(1, new ItemStack(GCItems.partNoseCone)); input.put(2, new ItemStack(GCItems.basicItem, 1, 14)); input.put(3, new ItemStack(MarsItems.marsItemBasic, 1, 3)); @@ -120,46 +128,49 @@ public static void addUniversalRecipes() input.put(12, new ItemStack(GCItems.partFins)); input.put(13, new ItemStack(GCItems.partFins)); - input2 = new HashMap(input); - input2.put(14, new ItemStack(Blocks.CHEST)); - input2.put(15, ItemStack.EMPTY); - input2.put(16, ItemStack.EMPTY); - MarsUtil.adCargoRocketRecipe(new ItemStack(MarsItems.rocketMars, 1, 11), input2); - - input2 = new HashMap(input); - input2.put(14, ItemStack.EMPTY); - input2.put(15, new ItemStack(Blocks.CHEST)); - input2.put(16, ItemStack.EMPTY); - MarsUtil.adCargoRocketRecipe(new ItemStack(MarsItems.rocketMars, 1, 11), input2); - - input2 = new HashMap(input); - input2.put(14, ItemStack.EMPTY); - input2.put(15, ItemStack.EMPTY); - input2.put(16, new ItemStack(Blocks.CHEST)); - MarsUtil.adCargoRocketRecipe(new ItemStack(MarsItems.rocketMars, 1, 11), input2); - - input2 = new HashMap(input); - input2.put(14, new ItemStack(Blocks.CHEST)); - input2.put(15, new ItemStack(Blocks.CHEST)); - input2.put(16, ItemStack.EMPTY); - MarsUtil.adCargoRocketRecipe(new ItemStack(MarsItems.rocketMars, 1, 12), input2); - - input2 = new HashMap(input); - input2.put(14, new ItemStack(Blocks.CHEST)); - input2.put(15, ItemStack.EMPTY); - input2.put(16, new ItemStack(Blocks.CHEST)); - MarsUtil.adCargoRocketRecipe(new ItemStack(MarsItems.rocketMars, 1, 12), input2); - - input2 = new HashMap(input); - input2.put(14, ItemStack.EMPTY); - input2.put(15, new ItemStack(Blocks.CHEST)); - input2.put(16, new ItemStack(Blocks.CHEST)); - MarsUtil.adCargoRocketRecipe(new ItemStack(MarsItems.rocketMars, 1, 12), input2); - - input2 = new HashMap(input); - input2.put(14, new ItemStack(Blocks.CHEST)); - input2.put(15, new ItemStack(Blocks.CHEST)); - input2.put(16, new ItemStack(Blocks.CHEST)); - MarsUtil.adCargoRocketRecipe(new ItemStack(MarsItems.rocketMars, 1, 13), input2); + for (ItemStack woodChest : woodChests) + { + input2 = new HashMap<>(input); + input2.put(14, woodChest); + input2.put(15, ItemStack.EMPTY); + input2.put(16, ItemStack.EMPTY); + MarsUtil.adCargoRocketRecipe(new ItemStack(MarsItems.rocketMars, 1, 11), input2); + + input2 = new HashMap<>(input); + input2.put(14, ItemStack.EMPTY); + input2.put(15, woodChest); + input2.put(16, ItemStack.EMPTY); + MarsUtil.adCargoRocketRecipe(new ItemStack(MarsItems.rocketMars, 1, 11), input2); + + input2 = new HashMap<>(input); + input2.put(14, ItemStack.EMPTY); + input2.put(15, ItemStack.EMPTY); + input2.put(16, woodChest); + MarsUtil.adCargoRocketRecipe(new ItemStack(MarsItems.rocketMars, 1, 11), input2); + + input2 = new HashMap<>(input); + input2.put(14, woodChest); + input2.put(15, woodChest); + input2.put(16, ItemStack.EMPTY); + MarsUtil.adCargoRocketRecipe(new ItemStack(MarsItems.rocketMars, 1, 12), input2); + + input2 = new HashMap<>(input); + input2.put(14, woodChest); + input2.put(15, ItemStack.EMPTY); + input2.put(16, woodChest); + MarsUtil.adCargoRocketRecipe(new ItemStack(MarsItems.rocketMars, 1, 12), input2); + + input2 = new HashMap<>(input); + input2.put(14, ItemStack.EMPTY); + input2.put(15, woodChest); + input2.put(16, woodChest); + MarsUtil.adCargoRocketRecipe(new ItemStack(MarsItems.rocketMars, 1, 12), input2); + + input2 = new HashMap<>(input); + input2.put(14, woodChest); + input2.put(15, woodChest); + input2.put(16, woodChest); + MarsUtil.adCargoRocketRecipe(new ItemStack(MarsItems.rocketMars, 1, 13), input2); + } } }