From ec93256cd2c9b498e3becf963f60a5be8d3ea2bc Mon Sep 17 00:00:00 2001 From: DarkGuardsman Date: Fri, 25 Oct 2013 02:46:45 -0400 Subject: [PATCH] Added recipes for ore processors --- .../client/render/BlockRenderingHandler.java | 4 +-- .../dark/assembly/common/ALRecipeLoader.java | 36 +++++++++++-------- .../dark/assembly/common/AssemblyLine.java | 4 +-- 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/src/minecraft/dark/assembly/client/render/BlockRenderingHandler.java b/src/minecraft/dark/assembly/client/render/BlockRenderingHandler.java index 231e3fb19..a4c567991 100644 --- a/src/minecraft/dark/assembly/client/render/BlockRenderingHandler.java +++ b/src/minecraft/dark/assembly/client/render/BlockRenderingHandler.java @@ -75,7 +75,7 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler RenderArmbot.MODEL.render(0.0625F, 0, 0); GL11.glPopMatrix(); } - else if (AssemblyLine.processorMachine != null && block.blockID == AssemblyLine.processorMachine.blockID && metadata == 0) + else if (AssemblyLine.recipeLoader.processorMachine != null && block.blockID == AssemblyLine.recipeLoader.processorMachine.blockID && metadata == 0) { FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(AssemblyLine.instance.DOMAIN, ModPrefab.MODEL_DIRECTORY + "CrusherBlock.png")); GL11.glPushMatrix(); @@ -86,7 +86,7 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler this.modelCrushor.renderPiston(0.0625f, 4); GL11.glPopMatrix(); } - else if (AssemblyLine.processorMachine != null && block.blockID == AssemblyLine.processorMachine.blockID && metadata == 4) + else if (AssemblyLine.recipeLoader.processorMachine != null && block.blockID == AssemblyLine.recipeLoader.processorMachine.blockID && metadata == 4) { FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(AssemblyLine.instance.DOMAIN, ModPrefab.MODEL_DIRECTORY + "GrinderBlock.png")); GL11.glPushMatrix(); diff --git a/src/minecraft/dark/assembly/common/ALRecipeLoader.java b/src/minecraft/dark/assembly/common/ALRecipeLoader.java index e87f01fc2..044e16471 100644 --- a/src/minecraft/dark/assembly/common/ALRecipeLoader.java +++ b/src/minecraft/dark/assembly/common/ALRecipeLoader.java @@ -7,25 +7,27 @@ import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; import cpw.mods.fml.common.registry.GameRegistry; import dark.assembly.common.machine.BlockCrate; +import dark.assembly.common.machine.processor.BlockProcessor; import dark.core.common.RecipeLoader; public class ALRecipeLoader extends RecipeLoader { - public Block blockConveyorBelt; - public Block blockManipulator; - public BlockCrate blockCrate; - public Block blockImprinter; - public Block blockEncoder; - public Block blockDetector; - public Block blockRejector; - public Block blockArmbot; - public Block blockCraneController; - public Block blockCraneFrame; - public Block blockTurntable; + public static Block blockConveyorBelt; + public static Block blockManipulator; + public static BlockCrate blockCrate; + public static Block blockImprinter; + public static Block blockEncoder; + public static Block blockDetector; + public static Block blockRejector; + public static Block blockArmbot; + public static Block blockCraneController; + public static Block blockCraneFrame; + public static Block blockTurntable; + public static Block processorMachine; - public Item itemImprint; - public Item itemDisk; + public static Item itemImprint; + public static Item itemDisk; @Override public void loadRecipes() @@ -38,7 +40,7 @@ public class ALRecipeLoader extends RecipeLoader private void createUERecipes() { // Armbot - GameRegistry.addRecipe(new ShapedOreRecipe(blockArmbot, new Object[] { "II ", "SIS", "MCM", 'S', RecipeLoader.steelPlate, 'C', RecipeLoader.circuit2, 'I', RecipeLoader.steel, 'M', RecipeLoader.motor })); + //GameRegistry.addRecipe(new ShapedOreRecipe(blockArmbot, new Object[] { "II ", "SIS", "MCM", 'S', RecipeLoader.steelPlate, 'C', RecipeLoader.circuit2, 'I', RecipeLoader.steel, 'M', RecipeLoader.motor })); // Disk GameRegistry.addRecipe(new ShapedOreRecipe(itemDisk, new Object[] { "III", "ICI", "III", 'I', itemImprint, 'C', RecipeLoader.circuit2 })); // Encoder @@ -53,6 +55,12 @@ public class ALRecipeLoader extends RecipeLoader GameRegistry.addRecipe(new ShapedOreRecipe(blockTurntable, new Object[] { "IMI", " P ", 'M', RecipeLoader.motor, 'P', Block.pistonBase, 'I', RecipeLoader.steel })); // Manipulator GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(blockManipulator, 2), new Object[] { Block.dispenser, RecipeLoader.circuit })); + if (processorMachine instanceof BlockProcessor) + { + new RecipeGrid(new ItemStack(processorMachine, 1, BlockProcessor.ProcessorData.GRINDER.startMeta), 3, 3).setRowOne(steel, steel, steel).setRowTwo(steelPlate, motor, steelPlate).setRowThree(steel, circuit2, steel).RegisterRecipe(); + new RecipeGrid(new ItemStack(processorMachine, 1, BlockProcessor.ProcessorData.CRUSHER.startMeta), 3, 3).setRowOne(steel, steelPlate, steel).setRowTwo(Block.pistonBase, steelPlate, Block.pistonBase).setRowThree(steel, circuit2, steel).RegisterRecipe(); + + } } private void createStandardRecipes() diff --git a/src/minecraft/dark/assembly/common/AssemblyLine.java b/src/minecraft/dark/assembly/common/AssemblyLine.java index 2c3af1f0b..0f523527d 100644 --- a/src/minecraft/dark/assembly/common/AssemblyLine.java +++ b/src/minecraft/dark/assembly/common/AssemblyLine.java @@ -91,7 +91,7 @@ public class AssemblyLine extends ModPrefab public static boolean REQUIRE_NO_POWER = false; public static boolean VINALLA_RECIPES = false; - public static Block processorMachine; + @Override @EventHandler @@ -156,7 +156,7 @@ public class AssemblyLine extends ModPrefab recipeLoader.blockEncoder = new BlockEncoder(); recipeLoader.blockArmbot = new BlockArmbot(); recipeLoader.blockTurntable = new BlockTurntable(); - AssemblyLine.processorMachine = ModObjectRegistry.createNewBlock("ALBlockProcessor", AssemblyLine.MOD_ID, BlockProcessor.class, ItemBlockHolder.class); + recipeLoader.processorMachine = ModObjectRegistry.createNewBlock("ALBlockProcessor", AssemblyLine.MOD_ID, BlockProcessor.class, ItemBlockHolder.class); recipeLoader.itemImprint = new ItemImprinter(CONFIGURATION.getItem("Imprint", ITEM_ID_PREFIX).getInt()); recipeLoader.itemDisk = new ItemDisk(CONFIGURATION.getItem("Disk", ITEM_ID_PREFIX + 1).getInt());