From 96f485042e8deb79a213e3a7a131239e031488dd Mon Sep 17 00:00:00 2001 From: DarkGuardsman Date: Mon, 22 Jul 2013 18:23:10 -0400 Subject: [PATCH] reworked recipe system and main class file --- .../dark/assembly/client/ClientProxy.java | 4 +- .../client/render/BlockRenderingHandler.java | 12 +- .../dark/assembly/common/ALRecipeLoader.java | 70 ++++++++++ .../dark/assembly/common/AssemblyLine.java | 126 ++++++++---------- .../dark/assembly/common/Recipes.java | 87 ------------ .../assembly/common/armbot/BlockArmbot.java | 2 +- .../common/armbot/TileEntityArmbot.java | 4 +- .../common/armbot/command/CommandBreak.java | 2 +- .../common/armbot/command/CommandPowerTo.java | 2 +- .../assembly/common/bottler/BlockBottler.java | 23 ++++ .../common/bottler/TileEntityBottler.java | 8 ++ .../common/imprinter/ContainerImprinter.java | 10 +- .../common/imprinter/TileEntityImprinter.java | 10 +- .../common/machine/BlockAssembly.java | 2 +- .../assembly/common/machine/BlockCrate.java | 4 +- .../machine/{detector => }/BlockDetector.java | 2 +- .../common/machine/InvInteractionHelper.java | 2 +- .../common/machine/TileEntityAssembly.java | 2 +- .../{detector => }/TileEntityDetector.java | 12 +- .../machine/belt/TileEntityConveyorBelt.java | 2 +- .../machine/encoder/ContainerEncoder.java | 4 +- .../common/machine/encoder/SlotDisk.java | 2 +- 22 files changed, 195 insertions(+), 197 deletions(-) create mode 100644 src/minecraft/dark/assembly/common/ALRecipeLoader.java delete mode 100644 src/minecraft/dark/assembly/common/Recipes.java create mode 100644 src/minecraft/dark/assembly/common/bottler/BlockBottler.java create mode 100644 src/minecraft/dark/assembly/common/bottler/TileEntityBottler.java rename src/minecraft/dark/assembly/common/machine/{detector => }/BlockDetector.java (98%) rename src/minecraft/dark/assembly/common/machine/{detector => }/TileEntityDetector.java (88%) diff --git a/src/minecraft/dark/assembly/client/ClientProxy.java b/src/minecraft/dark/assembly/client/ClientProxy.java index 4b35ad0e..876dd021 100644 --- a/src/minecraft/dark/assembly/client/ClientProxy.java +++ b/src/minecraft/dark/assembly/client/ClientProxy.java @@ -28,15 +28,15 @@ import dark.assembly.common.CommonProxy; import dark.assembly.common.armbot.TileEntityArmbot; import dark.assembly.common.imprinter.TileEntityImprinter; import dark.assembly.common.machine.TileEntityCrate; +import dark.assembly.common.machine.TileEntityDetector; import dark.assembly.common.machine.TileEntityManipulator; import dark.assembly.common.machine.TileEntityRejector; import dark.assembly.common.machine.belt.TileEntityConveyorBelt; import dark.assembly.common.machine.crane.TileEntityCraneController; import dark.assembly.common.machine.crane.TileEntityCraneRail; -import dark.assembly.common.machine.detector.TileEntityDetector; import dark.assembly.common.machine.encoder.TileEntityEncoder; import dark.core.DarkMain; -import dark.library.effects.FXBeam; +import dark.core.client.FXBeam; public class ClientProxy extends CommonProxy { diff --git a/src/minecraft/dark/assembly/client/render/BlockRenderingHandler.java b/src/minecraft/dark/assembly/client/render/BlockRenderingHandler.java index 5e4342b1..97260e55 100644 --- a/src/minecraft/dark/assembly/client/render/BlockRenderingHandler.java +++ b/src/minecraft/dark/assembly/client/render/BlockRenderingHandler.java @@ -29,7 +29,7 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler @Override public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - if (block.blockID == AssemblyLine.blockConveyorBelt.blockID) + if (block.blockID == AssemblyLine.recipeLoader.blockConveyorBelt.blockID) { GL11.glPushMatrix(); GL11.glTranslatef((float) 0.0F, (float) 1.5F, (float) 0.0F); @@ -38,7 +38,7 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler modelConveyorBelt.render(0.0625F, 0, false, false, false, false); GL11.glPopMatrix(); } - else if (block.blockID == AssemblyLine.blockRejector.blockID) + else if (block.blockID == AssemblyLine.recipeLoader.blockRejector.blockID) { FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(AssemblyLine.instance.DOMAIN, AssemblyLine.MODEL_DIRECTORY + "rejector.png")); GL11.glPushMatrix(); @@ -49,7 +49,7 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler modelEjector.renderPiston(0.0625F, 1); GL11.glPopMatrix(); } - else if (block.blockID == AssemblyLine.blockManipulator.blockID) + else if (block.blockID == AssemblyLine.recipeLoader.blockManipulator.blockID) { FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(AssemblyLine.instance.DOMAIN, AssemblyLine.MODEL_DIRECTORY + "manipulator1.png")); GL11.glPushMatrix(); @@ -59,7 +59,7 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler modelInjector.render(0.0625F, true, 0); GL11.glPopMatrix(); } - else if (block.blockID == AssemblyLine.blockArmbot.blockID) + else if (block.blockID == AssemblyLine.recipeLoader.blockArmbot.blockID) { FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(AssemblyLine.instance.DOMAIN, AssemblyLine.MODEL_DIRECTORY + RenderArmbot.TEXTURE)); GL11.glPushMatrix(); @@ -70,7 +70,7 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler RenderArmbot.MODEL.render(0.0625F, 0, 0); GL11.glPopMatrix(); } - else if (block.blockID == AssemblyLine.blockCraneController.blockID) + else if (block.blockID == AssemblyLine.recipeLoader.blockCraneController.blockID) { FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(AssemblyLine.instance.DOMAIN, AssemblyLine.MODEL_DIRECTORY + RenderCraneController.TEXTURE)); GL11.glPushMatrix(); @@ -80,7 +80,7 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler RenderCraneController.MODEL.render(0.0625f, false, false); GL11.glPopMatrix(); } - else if (block.blockID == AssemblyLine.blockCraneFrame.blockID) + else if (block.blockID == AssemblyLine.recipeLoader.blockCraneFrame.blockID) { FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(AssemblyLine.instance.DOMAIN, AssemblyLine.MODEL_DIRECTORY + RenderCraneFrame.TEXTURE)); GL11.glPushMatrix(); diff --git a/src/minecraft/dark/assembly/common/ALRecipeLoader.java b/src/minecraft/dark/assembly/common/ALRecipeLoader.java new file mode 100644 index 00000000..c46f90e9 --- /dev/null +++ b/src/minecraft/dark/assembly/common/ALRecipeLoader.java @@ -0,0 +1,70 @@ +package dark.assembly.common; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; +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.core.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 Item itemImprint; + public Item itemDisk; + + @Override + public void loadRecipes() + { + super.loadRecipes(); + this.createStandardRecipes(); + this.createUERecipes(); + } + + private void createUERecipes() + { + // Armbot + GameRegistry.addRecipe(new ShapedOreRecipe(blockArmbot, new Object[] { "II ", "SIS", "MCM", 'S', ALRecipeLoader.steelPlate, 'C', ALRecipeLoader.circuit2, 'I', ALRecipeLoader.steel, 'M', ALRecipeLoader.motor })); + // Disk + GameRegistry.addRecipe(new ShapedOreRecipe(itemDisk, new Object[] { "III", "ICI", "III", 'I', itemImprint, 'C', ALRecipeLoader.circuit2 })); + // Encoder + GameRegistry.addRecipe(new ShapedOreRecipe(blockEncoder, new Object[] { "SIS", "SCS", "SSS", 'I', itemImprint, 'S', ALRecipeLoader.steel, 'C', ALRecipeLoader.circuit2 })); + // Detector + GameRegistry.addRecipe(new ShapedOreRecipe(blockDetector, new Object[] { "SES", "SCS", "S S", 'S', ALRecipeLoader.steel, 'C', ALRecipeLoader.circuit, 'E', Item.eyeOfEnder })); + // Conveyor Belt + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockConveyorBelt, 10), new Object[] { "III", "WMW", 'I', ALRecipeLoader.steel, 'W', Block.planks, 'M', ALRecipeLoader.motor })); + // Rejector + GameRegistry.addRecipe(new ShapedOreRecipe(blockRejector, new Object[] { "CPC", "@R@", '@', steel, 'R', Item.redstone, 'P', Block.pistonBase, 'C', ALRecipeLoader.circuit })); + // Turntable + GameRegistry.addRecipe(new ShapedOreRecipe(blockTurntable, new Object[] { "IMI", " P ", 'M', ALRecipeLoader.motor, 'P', Block.pistonBase, 'I', ALRecipeLoader.steel })); + // Manipulator + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(blockManipulator, 2), new Object[] { Block.dispenser, ALRecipeLoader.circuit })); + } + + private void createStandardRecipes() + { + // Imprint + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemImprint, 2), new Object[] { "R", "P", "I", 'P', Item.paper, 'R', Item.redstone, 'I', new ItemStack(Item.dyePowder, 1, 0) })); + // Imprinter + GameRegistry.addRecipe(new ShapedOreRecipe(blockImprinter, new Object[] { "SIS", "SPS", "WCW", 'S', Item.ingotIron, 'C', Block.chest, 'W', Block.workbench, 'P', Block.pistonBase, 'I', new ItemStack(Item.dyePowder, 1, 0) })); + // Crate + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockCrate, 1, 0), new Object[] { "TST", "S S", "TST", 'S', Item.ingotIron, 'T', Block.planks })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockCrate, 1, 1), new Object[] { "TST", "SCS", "TST", 'C', new ItemStack(blockCrate, 1, 0), 'S', ALRecipeLoader.steel, 'T', Block.wood })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockCrate, 1, 2), new Object[] { "TST", "SCS", "TST", 'C', new ItemStack(blockCrate, 1, 1), 'S', ALRecipeLoader.steelPlate, 'T', Block.wood })); + } +} diff --git a/src/minecraft/dark/assembly/common/AssemblyLine.java b/src/minecraft/dark/assembly/common/AssemblyLine.java index 6b21e5f0..b3562b4a 100644 --- a/src/minecraft/dark/assembly/common/AssemblyLine.java +++ b/src/minecraft/dark/assembly/common/AssemblyLine.java @@ -35,11 +35,13 @@ import dark.assembly.common.imprinter.BlockImprinter; import dark.assembly.common.imprinter.ItemImprinter; import dark.assembly.common.imprinter.TileEntityImprinter; import dark.assembly.common.machine.BlockCrate; +import dark.assembly.common.machine.BlockDetector; import dark.assembly.common.machine.BlockManipulator; import dark.assembly.common.machine.BlockRejector; import dark.assembly.common.machine.BlockTurntable; import dark.assembly.common.machine.ItemBlockCrate; import dark.assembly.common.machine.TileEntityCrate; +import dark.assembly.common.machine.TileEntityDetector; import dark.assembly.common.machine.TileEntityManipulator; import dark.assembly.common.machine.TileEntityRejector; import dark.assembly.common.machine.belt.BlockConveyorBelt; @@ -48,15 +50,13 @@ import dark.assembly.common.machine.crane.BlockCraneController; import dark.assembly.common.machine.crane.BlockCraneFrame; import dark.assembly.common.machine.crane.TileEntityCraneController; import dark.assembly.common.machine.crane.TileEntityCraneRail; -import dark.assembly.common.machine.detector.BlockDetector; -import dark.assembly.common.machine.detector.TileEntityDetector; import dark.assembly.common.machine.encoder.BlockEncoder; import dark.assembly.common.machine.encoder.ItemDisk; import dark.assembly.common.machine.encoder.TileEntityEncoder; import dark.core.DarkMain; import dark.core.ModPrefab; -import dark.prefab.machine.BlockMulti; -import dark.prefab.machine.TileEntityMulti; +import dark.core.blocks.BlockMulti; +import dark.core.blocks.TileEntityMulti; @ModstatInfo(prefix = "asmline") @Mod(modid = AssemblyLine.CHANNEL, name = AssemblyLine.MOD_NAME, version = DarkMain.VERSION, dependencies = "after:DarkCore", useMetadata = true) @@ -82,6 +82,8 @@ public class AssemblyLine extends ModPrefab @Instance(AssemblyLine.CHANNEL) public static AssemblyLine instance; + public static ALRecipeLoader recipeLoader; + @Metadata(AssemblyLine.MOD_ID) public static ModMetadata meta; @@ -91,22 +93,6 @@ public class AssemblyLine extends ModPrefab public static final Configuration CONFIGURATION = new Configuration(new File(Loader.instance().getConfigDir(), "Dark/AssemblyLine.cfg")); - - 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 Item itemImprint; - public static Item itemDisk; - public static Logger FMLog = Logger.getLogger(AssemblyLine.MOD_NAME); // TODO: MAKE THIS FALSE EVERY BUILD! @@ -117,48 +103,27 @@ public class AssemblyLine extends ModPrefab @EventHandler public void preInit(FMLPreInitializationEvent event) { + super.preInit(event); FMLog.setParent(FMLLog.getLogger()); instance = this; + recipeLoader = new ALRecipeLoader(); /* UPDATE NOTIFIER */ Modstats.instance().getReporter().registerMod(this); - CONFIGURATION.load(); - blockConveyorBelt = new BlockConveyorBelt(BLOCK_ID_PREFIX); - blockManipulator = new BlockManipulator(BLOCK_ID_PREFIX++); - blockCrate = new BlockCrate(BLOCK_ID_PREFIX++); - blockImprinter = new BlockImprinter(BLOCK_ID_PREFIX++); - blockDetector = new BlockDetector(BLOCK_ID_PREFIX++); - blockRejector = new BlockRejector(BLOCK_ID_PREFIX++); - blockEncoder = new BlockEncoder(BLOCK_ID_PREFIX++); - blockArmbot = new BlockArmbot(BLOCK_ID_PREFIX++); - blockCraneController = new BlockCraneController(BLOCK_ID_PREFIX++); - blockCraneFrame = new BlockCraneFrame(BLOCK_ID_PREFIX++); - blockTurntable = new BlockTurntable(BLOCK_ID_PREFIX++); - - itemImprint = new ItemImprinter(CONFIGURATION.getItem("Imprint", ITEM_ID_PREFIX).getInt()); - itemDisk = new ItemDisk(CONFIGURATION.getItem("Disk", ITEM_ID_PREFIX + 1).getInt()); - - AssemblyLine.REQUIRE_NO_POWER = !CONFIGURATION.get("general", "requirePower", true).getBoolean(true); - AssemblyLine.VINALLA_RECIPES = CONFIGURATION.get("general", "Vinalla_Recipes", false).getBoolean(false); - if (CONFIGURATION.hasChanged()) - { - CONFIGURATION.save(); - } - NetworkRegistry.instance().registerGuiHandler(this, this.proxy); - GameRegistry.registerBlock(blockConveyorBelt, "ConveyorBelt"); - GameRegistry.registerBlock(blockCrate, ItemBlockCrate.class, "Crate"); - GameRegistry.registerBlock(blockManipulator, "Manipulator"); - GameRegistry.registerBlock(blockImprinter, "Imprinter"); - GameRegistry.registerBlock(blockEncoder, "Encoder"); - GameRegistry.registerBlock(blockDetector, "Detector"); - GameRegistry.registerBlock(blockRejector, "Rejector"); - GameRegistry.registerBlock(blockArmbot, "Armbot"); - GameRegistry.registerBlock(blockTurntable, "Turntable"); - GameRegistry.registerBlock(blockCraneController, "CraneController"); - GameRegistry.registerBlock(blockCraneFrame, "Crane Frame"); + GameRegistry.registerBlock(recipeLoader.blockConveyorBelt, "ConveyorBelt"); + GameRegistry.registerBlock(recipeLoader.blockCrate, ItemBlockCrate.class, "Crate"); + GameRegistry.registerBlock(recipeLoader.blockManipulator, "Manipulator"); + GameRegistry.registerBlock(recipeLoader.blockImprinter, "Imprinter"); + GameRegistry.registerBlock(recipeLoader.blockEncoder, "Encoder"); + GameRegistry.registerBlock(recipeLoader.blockDetector, "Detector"); + GameRegistry.registerBlock(recipeLoader.blockRejector, "Rejector"); + GameRegistry.registerBlock(recipeLoader.blockArmbot, "Armbot"); + GameRegistry.registerBlock(recipeLoader.blockTurntable, "Turntable"); + GameRegistry.registerBlock(recipeLoader.blockCraneController, "CraneController"); + GameRegistry.registerBlock(recipeLoader.blockCraneFrame, "Crane Frame"); GameRegistry.registerTileEntity(TileEntityConveyorBelt.class, "ALConveyorBelt"); GameRegistry.registerTileEntity(TileEntityRejector.class, "ALSorter"); @@ -171,7 +136,7 @@ public class AssemblyLine extends ModPrefab GameRegistry.registerTileEntity(TileEntityCraneRail.class, "ALCraneRail"); GameRegistry.registerTileEntity(TileEntityImprinter.class, "ALImprinter"); - TabAssemblyLine.itemStack = new ItemStack(AssemblyLine.blockConveyorBelt); + TabAssemblyLine.itemStack = new ItemStack(recipeLoader.blockConveyorBelt); proxy.preInit(); } @@ -179,24 +144,12 @@ public class AssemblyLine extends ModPrefab @EventHandler public void load(FMLInitializationEvent evt) { + super.init(evt); proxy.init(); FMLog.info("Loaded: " + TranslationHelper.loadLanguages(LANGUAGE_PATH, LANGUAGES_SUPPORTED) + " languages."); - /* MCMOD.INFO FILE BUILDER? */ - meta.modId = AssemblyLine.MOD_ID; - meta.name = AssemblyLine.MOD_NAME; - meta.description = "Simi Realistic factory system for minecraft bring in conveyor belts, robotic arms, and simple machines"; - - meta.url = "http://universalelectricity.com/assembly-line"; - - meta.logoFile = "/al_logo.png"; - meta.version = DarkMain.VERSION; - meta.authorList = Arrays.asList(new String[] { "DarkGuardsman" }); - meta.credits = "Please see the website."; - meta.autogenerated = false; - - Recipes.loadRecipes(); + recipeLoader.loadRecipes(); } @@ -209,14 +162,45 @@ public class AssemblyLine extends ModPrefab @Override public void loadConfig() { - // TODO Auto-generated method stub + CONFIGURATION.load(); + recipeLoader.blockConveyorBelt = new BlockConveyorBelt(BLOCK_ID_PREFIX); + recipeLoader.blockManipulator = new BlockManipulator(BLOCK_ID_PREFIX++); + recipeLoader.blockCrate = new BlockCrate(BLOCK_ID_PREFIX++); + recipeLoader.blockImprinter = new BlockImprinter(BLOCK_ID_PREFIX++); + recipeLoader.blockDetector = new BlockDetector(BLOCK_ID_PREFIX++); + recipeLoader.blockRejector = new BlockRejector(BLOCK_ID_PREFIX++); + recipeLoader.blockEncoder = new BlockEncoder(BLOCK_ID_PREFIX++); + recipeLoader.blockArmbot = new BlockArmbot(BLOCK_ID_PREFIX++); + recipeLoader.blockCraneController = new BlockCraneController(BLOCK_ID_PREFIX++); + recipeLoader.blockCraneFrame = new BlockCraneFrame(BLOCK_ID_PREFIX++); + recipeLoader.blockTurntable = new BlockTurntable(BLOCK_ID_PREFIX++); + + recipeLoader.itemImprint = new ItemImprinter(CONFIGURATION.getItem("Imprint", ITEM_ID_PREFIX).getInt()); + recipeLoader.itemDisk = new ItemDisk(CONFIGURATION.getItem("Disk", ITEM_ID_PREFIX + 1).getInt()); + + AssemblyLine.REQUIRE_NO_POWER = !CONFIGURATION.get("general", "requirePower", true).getBoolean(true); + AssemblyLine.VINALLA_RECIPES = CONFIGURATION.get("general", "Vinalla_Recipes", false).getBoolean(false); + if (CONFIGURATION.hasChanged()) + { + CONFIGURATION.save(); + } } @Override public void loadModMeta() { - // TODO Auto-generated method stub + meta.modId = AssemblyLine.MOD_ID; + meta.name = AssemblyLine.MOD_NAME; + meta.description = "Simi Realistic factory system for minecraft bring in conveyor belts, robotic arms, and simple machines"; + + meta.url = "http://universalelectricity.com/assembly-line"; + + meta.logoFile = "/al_logo.png"; + meta.version = DarkMain.VERSION; + meta.authorList = Arrays.asList(new String[] { "DarkGuardsman" }); + meta.credits = "Please see the website."; + meta.autogenerated = false; } } diff --git a/src/minecraft/dark/assembly/common/Recipes.java b/src/minecraft/dark/assembly/common/Recipes.java deleted file mode 100644 index 66097c9f..00000000 --- a/src/minecraft/dark/assembly/common/Recipes.java +++ /dev/null @@ -1,87 +0,0 @@ -package dark.assembly.common; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import net.minecraftforge.oredict.ShapedOreRecipe; -import net.minecraftforge.oredict.ShapelessOreRecipe; -import cpw.mods.fml.common.registry.GameRegistry; - -public class Recipes -{ - static Object circuit; - static Object circuit2; - static Object circuit3; - static Object steel; - static Object steelPlate; - static Object motor; - - public static void loadRecipes() - { - circuit = Item.redstoneRepeater; - circuit2 = Item.comparator; - steel = Item.ingotIron; - steelPlate = Item.ingotGold; - motor = Block.pistonBase; - - if (!AssemblyLine.VINALLA_RECIPES) - { - if (OreDictionary.getOres("basicCircuit").size() > 0) - { - circuit = "basicCircuit"; - } - if (OreDictionary.getOres("advancedCircuit").size() > 0) - { - circuit = "advancedCircuit"; - } - if (OreDictionary.getOres("ingotSteel").size() > 0) - { - steel = "ingotSteel"; - } - if (OreDictionary.getOres("plateSteel").size() > 0) - { - steelPlate = "plateSteel"; - } - if (OreDictionary.getOres("motor").size() > 0) - { - motor = "motor"; - } - - } - Recipes.createStandardRecipes(); - Recipes.createUERecipes(); - } - - private static void createUERecipes() - { - // Armbot - GameRegistry.addRecipe(new ShapedOreRecipe(AssemblyLine.blockArmbot, new Object[] { "II ", "SIS", "MCM", 'S', Recipes.steelPlate, 'C', Recipes.circuit2, 'I', Recipes.steel, 'M', Recipes.motor })); - // Disk - GameRegistry.addRecipe(new ShapedOreRecipe(AssemblyLine.itemDisk, new Object[] { "III", "ICI", "III", 'I', AssemblyLine.itemImprint, 'C', Recipes.circuit2 })); - // Encoder - GameRegistry.addRecipe(new ShapedOreRecipe(AssemblyLine.blockEncoder, new Object[] { "SIS", "SCS", "SSS", 'I', AssemblyLine.itemImprint, 'S', Recipes.steel, 'C', Recipes.circuit2 })); - // Detector - GameRegistry.addRecipe(new ShapedOreRecipe(AssemblyLine.blockDetector, new Object[] { "SES", "SCS", "S S", 'S', Recipes.steel, 'C', Recipes.circuit, 'E', Item.eyeOfEnder })); - // Conveyor Belt - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(AssemblyLine.blockConveyorBelt, 10), new Object[] { "III", "WMW", 'I', Recipes.steel, 'W', Block.planks, 'M', Recipes.motor })); - // Rejector - GameRegistry.addRecipe(new ShapedOreRecipe(AssemblyLine.blockRejector, new Object[] { "CPC", "@R@", '@', Recipes.steel, 'R', Item.redstone, 'P', Block.pistonBase, 'C', Recipes.circuit })); - // Turntable - GameRegistry.addRecipe(new ShapedOreRecipe(AssemblyLine.blockTurntable, new Object[] { "IMI", " P ", 'M', Recipes.motor, 'P', Block.pistonBase, 'I', Recipes.steel })); - // Manipulator - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(AssemblyLine.blockManipulator, 2), new Object[] { Block.dispenser, Recipes.circuit })); - } - - private static void createStandardRecipes() - { - // Imprint - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(AssemblyLine.itemImprint, 2), new Object[] { "R", "P", "I", 'P', Item.paper, 'R', Item.redstone, 'I', new ItemStack(Item.dyePowder, 1, 0) })); - // Imprinter - GameRegistry.addRecipe(new ShapedOreRecipe(AssemblyLine.blockImprinter, new Object[] { "SIS", "SPS", "WCW", 'S', Item.ingotIron, 'C', Block.chest, 'W', Block.workbench, 'P', Block.pistonBase, 'I', new ItemStack(Item.dyePowder, 1, 0) })); - // Crate - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(AssemblyLine.blockCrate, 1, 0), new Object[] { "TST", "S S", "TST", 'S', Item.ingotIron, 'T', Block.planks })); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(AssemblyLine.blockCrate, 1, 1), new Object[] { "TST", "SCS", "TST", 'C', new ItemStack(AssemblyLine.blockCrate, 1, 0), 'S', Recipes.steel, 'T', Block.wood })); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(AssemblyLine.blockCrate, 1, 2), new Object[] { "TST", "SCS", "TST", 'C', new ItemStack(AssemblyLine.blockCrate, 1, 1), 'S', Recipes.steelPlate, 'T', Block.wood })); - } -} diff --git a/src/minecraft/dark/assembly/common/armbot/BlockArmbot.java b/src/minecraft/dark/assembly/common/armbot/BlockArmbot.java index 41d02082..ed753043 100644 --- a/src/minecraft/dark/assembly/common/armbot/BlockArmbot.java +++ b/src/minecraft/dark/assembly/common/armbot/BlockArmbot.java @@ -12,7 +12,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import dark.assembly.client.render.BlockRenderingHandler; import dark.assembly.common.machine.BlockAssembly; -import dark.prefab.machine.IMultiBlock; +import dark.core.blocks.IMultiBlock; public class BlockArmbot extends BlockAssembly { diff --git a/src/minecraft/dark/assembly/common/armbot/TileEntityArmbot.java b/src/minecraft/dark/assembly/common/armbot/TileEntityArmbot.java index 0cb3f5bf..ede4903d 100644 --- a/src/minecraft/dark/assembly/common/armbot/TileEntityArmbot.java +++ b/src/minecraft/dark/assembly/common/armbot/TileEntityArmbot.java @@ -41,8 +41,8 @@ import dark.assembly.common.armbot.command.CommandUse; import dark.assembly.common.machine.TileEntityAssembly; import dark.assembly.common.machine.encoder.ItemDisk; import dark.core.DarkMain; -import dark.helpers.ItemFindingHelper; -import dark.prefab.machine.IMultiBlock; +import dark.core.blocks.IMultiBlock; +import dark.core.helpers.ItemFindingHelper; public class TileEntityArmbot extends TileEntityAssembly implements IMultiBlock, IInventory, IPacketReceiver, IArmbot, IPeripheral { diff --git a/src/minecraft/dark/assembly/common/armbot/command/CommandBreak.java b/src/minecraft/dark/assembly/common/armbot/command/CommandBreak.java index a9645c6b..55ad465c 100644 --- a/src/minecraft/dark/assembly/common/armbot/command/CommandBreak.java +++ b/src/minecraft/dark/assembly/common/armbot/command/CommandBreak.java @@ -6,7 +6,7 @@ import net.minecraft.block.Block; import net.minecraft.entity.item.EntityItem; import net.minecraft.item.ItemStack; import universalelectricity.core.vector.Vector3; -import dark.helpers.ItemFindingHelper; +import dark.core.helpers.ItemFindingHelper; /** * Used by arms to break a specific block in a position. diff --git a/src/minecraft/dark/assembly/common/armbot/command/CommandPowerTo.java b/src/minecraft/dark/assembly/common/armbot/command/CommandPowerTo.java index 8e49aa4f..5cc0590e 100644 --- a/src/minecraft/dark/assembly/common/armbot/command/CommandPowerTo.java +++ b/src/minecraft/dark/assembly/common/armbot/command/CommandPowerTo.java @@ -9,7 +9,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.ForgeDirection; import universalelectricity.core.vector.Vector3; -import dark.helpers.ItemFindingHelper; +import dark.core.helpers.ItemFindingHelper; public class CommandPowerTo extends Command { diff --git a/src/minecraft/dark/assembly/common/bottler/BlockBottler.java b/src/minecraft/dark/assembly/common/bottler/BlockBottler.java new file mode 100644 index 00000000..f36fb393 --- /dev/null +++ b/src/minecraft/dark/assembly/common/bottler/BlockBottler.java @@ -0,0 +1,23 @@ +package dark.assembly.common.bottler; + +import net.minecraft.block.material.Material; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import dark.assembly.common.machine.BlockAssembly; + +public class BlockBottler extends BlockAssembly +{ + + public BlockBottler(int id) + { + super(id, Material.iron, "AutoBottler"); + // TODO Auto-generated constructor stub + } + + @Override + public TileEntity createNewTileEntity(World world) + { + return null; + } + +} diff --git a/src/minecraft/dark/assembly/common/bottler/TileEntityBottler.java b/src/minecraft/dark/assembly/common/bottler/TileEntityBottler.java new file mode 100644 index 00000000..fbbfcbc4 --- /dev/null +++ b/src/minecraft/dark/assembly/common/bottler/TileEntityBottler.java @@ -0,0 +1,8 @@ +package dark.assembly.common.bottler; + +import dark.core.blocks.TileEntityMachine; + +public class TileEntityBottler extends TileEntityMachine +{ + +} diff --git a/src/minecraft/dark/assembly/common/imprinter/ContainerImprinter.java b/src/minecraft/dark/assembly/common/imprinter/ContainerImprinter.java index 780f4176..944e82d9 100644 --- a/src/minecraft/dark/assembly/common/imprinter/ContainerImprinter.java +++ b/src/minecraft/dark/assembly/common/imprinter/ContainerImprinter.java @@ -6,10 +6,10 @@ import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import dark.assembly.common.AssemblyLine; -import dark.library.gui.ISlotWatcher; -import dark.library.gui.SlotCraftingResult; -import dark.library.gui.SlotRestricted; -import dark.library.gui.WatchedSlot; +import dark.core.gui.ISlotWatcher; +import dark.core.gui.SlotCraftingResult; +import dark.core.gui.SlotRestricted; +import dark.core.gui.WatchedSlot; public class ContainerImprinter extends Container implements ISlotWatcher { @@ -34,7 +34,7 @@ public class ContainerImprinter extends Container implements ISlotWatcher } // Imprint Input for Imprinting - this.addSlotToContainer(new SlotRestricted(this.tileEntity, TileEntityImprinter.IMPRINTER_MATRIX_START, 68, 34, new ItemStack(AssemblyLine.itemImprint))); + this.addSlotToContainer(new SlotRestricted(this.tileEntity, TileEntityImprinter.IMPRINTER_MATRIX_START, 68, 34, new ItemStack(AssemblyLine.recipeLoader.itemImprint))); // Item to be imprinted this.addSlotToContainer(new WatchedSlot(this.tileEntity, TileEntityImprinter.IMPRINTER_MATRIX_START + 1, 92, 34, this)); // Result of Crafting/Imprinting diff --git a/src/minecraft/dark/assembly/common/imprinter/TileEntityImprinter.java b/src/minecraft/dark/assembly/common/imprinter/TileEntityImprinter.java index ea89e7c9..38511056 100644 --- a/src/minecraft/dark/assembly/common/imprinter/TileEntityImprinter.java +++ b/src/minecraft/dark/assembly/common/imprinter/TileEntityImprinter.java @@ -27,11 +27,11 @@ import com.google.common.io.ByteArrayDataInput; import dark.assembly.api.IArmbot; import dark.assembly.api.IArmbotUseable; import dark.assembly.common.AssemblyLine; -import dark.helpers.Pair; -import dark.library.gui.ISlotPickResult; -import dark.prefab.machine.AutoCraftingManager; -import dark.prefab.machine.IAutoCrafter; -import dark.prefab.machine.TileEntityMulti; +import dark.core.blocks.TileEntityMulti; +import dark.core.gui.ISlotPickResult; +import dark.core.helpers.AutoCraftingManager; +import dark.core.helpers.IAutoCrafter; +import dark.core.helpers.Pair; public class TileEntityImprinter extends TileEntityAdvanced implements ISidedInventory, IArmbotUseable, IPacketReceiver, ISlotPickResult, IAutoCrafter { diff --git a/src/minecraft/dark/assembly/common/machine/BlockAssembly.java b/src/minecraft/dark/assembly/common/machine/BlockAssembly.java index d40ed9a9..d001e850 100644 --- a/src/minecraft/dark/assembly/common/machine/BlockAssembly.java +++ b/src/minecraft/dark/assembly/common/machine/BlockAssembly.java @@ -11,7 +11,7 @@ import cpw.mods.fml.relauncher.SideOnly; import dark.api.INetworkPart; import dark.assembly.common.AssemblyLine; import dark.assembly.common.TabAssemblyLine; -import dark.prefab.machine.BlockMachine; +import dark.core.blocks.BlockMachine; public abstract class BlockAssembly extends BlockMachine { diff --git a/src/minecraft/dark/assembly/common/machine/BlockCrate.java b/src/minecraft/dark/assembly/common/machine/BlockCrate.java index 5c1a866d..ceb1d617 100644 --- a/src/minecraft/dark/assembly/common/machine/BlockCrate.java +++ b/src/minecraft/dark/assembly/common/machine/BlockCrate.java @@ -136,7 +136,7 @@ public class BlockCrate extends BlockAssembly { if (checkTile instanceof TileEntityCrate) { - AssemblyLine.blockCrate.tryInsert(((TileEntityCrate) checkTile), player, allMode, false); + AssemblyLine.recipeLoader.blockCrate.tryInsert(((TileEntityCrate) checkTile), player, allMode, false); } } } @@ -177,7 +177,7 @@ public class BlockCrate extends BlockAssembly if (currentStack != null) { - if (currentStack.getItem().itemID == AssemblyLine.blockCrate.blockID) + if (currentStack.getItem().itemID == AssemblyLine.recipeLoader.blockCrate.blockID) { ItemStack containedStack = ItemBlockCrate.getContainingItemStack(currentStack); ItemStack crateStack = tileEntity.getSampleStack(); diff --git a/src/minecraft/dark/assembly/common/machine/detector/BlockDetector.java b/src/minecraft/dark/assembly/common/machine/BlockDetector.java similarity index 98% rename from src/minecraft/dark/assembly/common/machine/detector/BlockDetector.java rename to src/minecraft/dark/assembly/common/machine/BlockDetector.java index cb61ee81..1094e015 100644 --- a/src/minecraft/dark/assembly/common/machine/detector/BlockDetector.java +++ b/src/minecraft/dark/assembly/common/machine/BlockDetector.java @@ -1,4 +1,4 @@ -package dark.assembly.common.machine.detector; +package dark.assembly.common.machine; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.entity.EntityLivingBase; diff --git a/src/minecraft/dark/assembly/common/machine/InvInteractionHelper.java b/src/minecraft/dark/assembly/common/machine/InvInteractionHelper.java index 724548a3..dbd9b34f 100644 --- a/src/minecraft/dark/assembly/common/machine/InvInteractionHelper.java +++ b/src/minecraft/dark/assembly/common/machine/InvInteractionHelper.java @@ -12,7 +12,7 @@ import net.minecraft.tileentity.TileEntityChest; import net.minecraft.world.World; import net.minecraftforge.common.ForgeDirection; import universalelectricity.core.vector.Vector3; -import dark.prefab.machine.TileEntityMulti; +import dark.core.blocks.TileEntityMulti; public class InvInteractionHelper { diff --git a/src/minecraft/dark/assembly/common/machine/TileEntityAssembly.java b/src/minecraft/dark/assembly/common/machine/TileEntityAssembly.java index 4fed92de..ab1755d0 100644 --- a/src/minecraft/dark/assembly/common/machine/TileEntityAssembly.java +++ b/src/minecraft/dark/assembly/common/machine/TileEntityAssembly.java @@ -23,8 +23,8 @@ import com.google.common.io.ByteArrayDataInput; import dark.api.INetworkPart; import dark.assembly.common.AssemblyLine; +import dark.core.blocks.TileEntityMachine; import dark.core.tile.network.NetworkTileEntities; -import dark.prefab.machine.TileEntityMachine; /** A class to be inherited by all machines on the assembly line. This class acts as a single peace * in a network of similar tiles allowing all to share power from one or more sources diff --git a/src/minecraft/dark/assembly/common/machine/detector/TileEntityDetector.java b/src/minecraft/dark/assembly/common/machine/TileEntityDetector.java similarity index 88% rename from src/minecraft/dark/assembly/common/machine/detector/TileEntityDetector.java rename to src/minecraft/dark/assembly/common/machine/TileEntityDetector.java index 7d605201..fe520dc5 100644 --- a/src/minecraft/dark/assembly/common/machine/detector/TileEntityDetector.java +++ b/src/minecraft/dark/assembly/common/machine/TileEntityDetector.java @@ -1,4 +1,4 @@ -package dark.assembly.common.machine.detector; +package dark.assembly.common.machine; import java.util.ArrayList; @@ -58,13 +58,13 @@ public class TileEntityDetector extends TileEntityFilterable if (powerCheck != this.powering) { this.powering = powerCheck; - this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, AssemblyLine.blockDetector.blockID); - this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord + 1, this.zCoord, AssemblyLine.blockDetector.blockID); + this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, AssemblyLine.recipeLoader.blockDetector.blockID); + this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord + 1, this.zCoord, AssemblyLine.recipeLoader.blockDetector.blockID); for (int x = this.xCoord - 1; x <= this.xCoord + 1; x++) { for (int z = this.zCoord - 1; z <= this.zCoord + 1; z++) { - this.worldObj.notifyBlocksOfNeighborChange(x, this.yCoord + 1, z, AssemblyLine.blockDetector.blockID); + this.worldObj.notifyBlocksOfNeighborChange(x, this.yCoord + 1, z, AssemblyLine.recipeLoader.blockDetector.blockID); } } @@ -76,8 +76,8 @@ public class TileEntityDetector extends TileEntityFilterable @Override public void invalidate() { - this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, AssemblyLine.blockDetector.blockID); - this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord + 1, this.zCoord, AssemblyLine.blockDetector.blockID); + this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, AssemblyLine.recipeLoader.blockDetector.blockID); + this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord + 1, this.zCoord, AssemblyLine.recipeLoader.blockDetector.blockID); super.invalidate(); } diff --git a/src/minecraft/dark/assembly/common/machine/belt/TileEntityConveyorBelt.java b/src/minecraft/dark/assembly/common/machine/belt/TileEntityConveyorBelt.java index 6ae6773e..23b6e9f4 100644 --- a/src/minecraft/dark/assembly/common/machine/belt/TileEntityConveyorBelt.java +++ b/src/minecraft/dark/assembly/common/machine/belt/TileEntityConveyorBelt.java @@ -60,7 +60,7 @@ public class TileEntityConveyorBelt extends TileEntityAssembly implements IPacke if (this.worldObj.isRemote && this.isRunning() && !this.worldObj.isBlockIndirectlyGettingPowered(this.xCoord, this.yCoord, this.zCoord)) { - if (this.ticks % 10 == 0 && this.worldObj.isRemote && this.worldObj.getBlockId(this.xCoord - 1, this.yCoord, this.zCoord) != AssemblyLine.blockConveyorBelt.blockID && this.worldObj.getBlockId(xCoord, yCoord, zCoord - 1) != AssemblyLine.blockConveyorBelt.blockID) + if (this.ticks % 10 == 0 && this.worldObj.isRemote && this.worldObj.getBlockId(this.xCoord - 1, this.yCoord, this.zCoord) != AssemblyLine.recipeLoader.blockConveyorBelt.blockID && this.worldObj.getBlockId(xCoord, yCoord, zCoord - 1) != AssemblyLine.recipeLoader.blockConveyorBelt.blockID) { this.worldObj.playSound(this.xCoord, this.yCoord, this.zCoord, "mods.assemblyline.conveyor", 0.5f, 0.7f, true); } diff --git a/src/minecraft/dark/assembly/common/machine/encoder/ContainerEncoder.java b/src/minecraft/dark/assembly/common/machine/encoder/ContainerEncoder.java index 59317ac4..07dc70e4 100644 --- a/src/minecraft/dark/assembly/common/machine/encoder/ContainerEncoder.java +++ b/src/minecraft/dark/assembly/common/machine/encoder/ContainerEncoder.java @@ -6,7 +6,7 @@ import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import dark.assembly.common.AssemblyLine; -import dark.library.gui.SlotRestricted; +import dark.core.gui.SlotRestricted; public class ContainerEncoder extends Container { @@ -22,7 +22,7 @@ public class ContainerEncoder extends Container this.tileEntity = encoder; // Disk - this.addSlotToContainer(new SlotRestricted(encoder, 0, 80, 24 + Y_OFFSET, new ItemStack(AssemblyLine.itemDisk))); + this.addSlotToContainer(new SlotRestricted(encoder, 0, 80, 24 + Y_OFFSET, new ItemStack(AssemblyLine.recipeLoader.itemDisk))); int var3; diff --git a/src/minecraft/dark/assembly/common/machine/encoder/SlotDisk.java b/src/minecraft/dark/assembly/common/machine/encoder/SlotDisk.java index 09d96083..22e8960a 100644 --- a/src/minecraft/dark/assembly/common/machine/encoder/SlotDisk.java +++ b/src/minecraft/dark/assembly/common/machine/encoder/SlotDisk.java @@ -15,7 +15,7 @@ public class SlotDisk extends Slot public boolean isItemValid(ItemStack itemStack) { - return itemStack.itemID == AssemblyLine.itemDisk.itemID; + return itemStack.itemID == AssemblyLine.recipeLoader.itemDisk.itemID; } }