Worked on player crafting recipes

This commit is contained in:
DarkGuardsman 2013-09-21 19:34:17 -04:00
parent 11f35acabe
commit c9b7e5be06
5 changed files with 57 additions and 30 deletions

View file

@ -59,7 +59,7 @@ public class ClientProxy extends CommonProxy
{
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityWire.class, new RenderBlockWire());
}
if (DarkMain.blockSolar != null)
if (CoreRecipeLoader.blockSolar != null)
{
ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySolarPanel.class, new RenderBlockSolarPanel());
}

View file

@ -13,6 +13,7 @@ import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import dark.core.client.models.ModelSolarPanel;
import dark.core.common.CoreRecipeLoader;
import dark.core.common.DarkMain;
import dark.core.prefab.ModPrefab;
@ -27,7 +28,7 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer)
{
GL11.glPushMatrix();
if (DarkMain.blockSolar != null && block.blockID == DarkMain.blockSolar.blockID)
if (CoreRecipeLoader.blockSolar != null && block.blockID == CoreRecipeLoader.blockSolar.blockID)
{
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(DarkMain.getInstance().DOMAIN, ModPrefab.MODEL_DIRECTORY + "solarPanel.png"));
GL11.glTranslatef(0.0F, 1.5F, 0.0F);

View file

@ -27,6 +27,7 @@ public class CoreRecipeLoader extends RecipeLoader
public static Block blockColorSand;
public static Block blockBasalt;
public static Block blockGlowGlass;
public static Block basicMachine, blockSolar;
/* ITEMS */
public static Item itemMetals, battery, itemTool, itemParts;
@ -43,7 +44,7 @@ public class CoreRecipeLoader extends RecipeLoader
{
super.loadRecipes();
new RecipeGrid(new ItemStack(itemTool, 1, 0), 3, 2).setRowOne("ironTube", "valvePart", "ironTube").setRowTwo(null, "ironTube", null).RegisterRecipe();
new RecipeGrid(new ItemStack(blockSolar, 1, 0), 3, 3).setRowOne(Block.glass, Block.glass, Block.glass).setRowTwo(this.steel, this.circuit, this.steel).setRowThree(this.steel, "copperWire", this.steel).RegisterRecipe();
this.loadParts();
}
@ -107,38 +108,60 @@ public class CoreRecipeLoader extends RecipeLoader
//Ore material recipe loop
for (EnumMaterial mat : EnumMaterial.values())
{
ItemStack dust = EnumMaterial.getStack(mat, EnumOrePart.DUST, 2);
ItemStack dust = EnumMaterial.getStack(mat, EnumOrePart.DUST, 1);
ItemStack ingot = EnumMaterial.getStack(mat, EnumOrePart.INGOTS, 1);
ItemStack scraps = EnumMaterial.getStack(mat, EnumOrePart.SCRAPS, 1);
ItemStack plates = EnumMaterial.getStack(mat, EnumOrePart.PLATES, 1);
ItemStack rubble = EnumMaterial.getStack(mat, EnumOrePart.RUBBLE, 1);
//Smelting recipes
FurnaceRecipes.smelting().addSmelting(dust.itemID, dust.getItemDamage(), ingot, 0.6f);
FurnaceRecipes.smelting().addSmelting(scraps.itemID, scraps.getItemDamage(), ingot, 0.6f);
//Dust recipes
ProcessorRecipes.createRecipe(ProcessorType.GRINDER, rubble, dust);
dust.stackSize = 1;
ProcessorRecipes.createRecipe(ProcessorType.GRINDER, scraps, dust);
ProcessorRecipes.createRecipe(ProcessorType.GRINDER, ingot, dust);
ProcessorRecipes.createSalvageDamageOutput(ProcessorType.GRINDER, ingot, dust);
if (mat.shouldCreateItem(EnumOrePart.DUST))
{
dust.stackSize = 2;
FurnaceRecipes.smelting().addSmelting(dust.itemID, dust.getItemDamage(), ingot, 0.6f);
ProcessorRecipes.createRecipe(ProcessorType.GRINDER, rubble, dust);
dust.stackSize = 1;
ProcessorRecipes.createRecipe(ProcessorType.GRINDER, scraps, dust);
ProcessorRecipes.createRecipe(ProcessorType.GRINDER, ingot, dust);
ProcessorRecipes.createSalvageDamageOutput(ProcessorType.GRINDER, ingot, dust);
dust.stackSize = 2;
ProcessorRecipes.createRecipe(ProcessorType.GRINDER, plates, dust);
ProcessorRecipes.createSalvageDamageOutput(ProcessorType.GRINDER, plates, dust);
dust.stackSize = 1;
}
// Salvaging recipe
scraps.stackSize = 3;
dust.stackSize = 2;
ProcessorRecipes.createRecipe(ProcessorType.CRUSHER, plates, scraps);
ProcessorRecipes.createSalvageDamageOutput(ProcessorType.CRUSHER, plates, scraps);
ProcessorRecipes.createRecipe(ProcessorType.GRINDER, plates, dust);
ProcessorRecipes.createSalvageDamageOutput(ProcessorType.GRINDER, plates, dust);
scraps.stackSize = 2;
ProcessorRecipes.createRecipe(ProcessorType.CRUSHER, rubble, scraps);
scraps.stackSize = 1;
ProcessorRecipes.createSalvageDamageOutput(ProcessorType.CRUSHER, ingot, scraps);
//Press recipes TODO set this up another way since input.stackSize can only equal 1
//ingot.stackSize = 3;
//ProcessorRecipes.createRecipe(ProcessorType.PRESS, ingot, plates);
if (mat.shouldCreateItem(EnumOrePart.SCRAPS))
{
FurnaceRecipes.smelting().addSmelting(scraps.itemID, scraps.getItemDamage(), ingot, 0.6f);
scraps.stackSize = 3;
ProcessorRecipes.createRecipe(ProcessorType.CRUSHER, plates, scraps);
ProcessorRecipes.createSalvageDamageOutput(ProcessorType.CRUSHER, plates, scraps);
scraps.stackSize = 2;
ProcessorRecipes.createRecipe(ProcessorType.CRUSHER, rubble, scraps);
scraps.stackSize = 1;
ProcessorRecipes.createSalvageDamageOutput(ProcessorType.CRUSHER, ingot, scraps);
}
ingot.stackSize = 1;
if (mat.shouldCreateItem(EnumOrePart.TUBE))
{
new RecipeGrid(mat.getStack(EnumOrePart.TUBE, 3), 3, 1).setRowOne(ingot, ingot, ingot).RegisterRecipe();
new RecipeGrid(mat.getStack(EnumOrePart.ROD, 1), 1, 1).setRowOne(mat.getStack(EnumOrePart.TUBE, 1)).RegisterRecipe();
}
if (mat.shouldCreateItem(EnumOrePart.ROD))
{
new RecipeGrid(mat.getStack(EnumOrePart.ROD, 3), 2, 1).setRowOne(ingot, ingot).RegisterRecipe();
}
if (mat.shouldCreateItem(EnumOrePart.PLATES))
{
new RecipeGrid(mat.getStack(EnumOrePart.PLATES, 1), 2, 2).setRowOne(ingot, ingot).setRowTwo(ingot, ingot).RegisterRecipe();
}
if (mat.shouldCreateItem(EnumOrePart.GEARS))
{
new RecipeGrid(mat.getStack(EnumOrePart.GEARS, 1), 3, 3).setRowOne(null, ingot, null).setRowTwo(ingot, Item.stick, ingot).setRowThree(null, ingot, null).RegisterRecipe();
}
}
}

View file

@ -89,7 +89,6 @@ public class DarkMain extends ModPrefab
public static boolean overPressureDamage;
public static BlockMulti blockMulti;
public static Block basicMachine, blockSolar;
@Instance(MOD_ID)
private static DarkMain instance;
@ -190,7 +189,7 @@ public class DarkMain extends ModPrefab
{
blockMulti = (BlockMulti) m;
}
basicMachine = ModObjectRegistry.createNewBlock("DMBlockBasicMachine", DarkMain.MOD_ID, BlockBasicMachine.class, ItemBlockHolder.class);
CoreRecipeLoader.basicMachine = ModObjectRegistry.createNewBlock("DMBlockBasicMachine", DarkMain.MOD_ID, BlockBasicMachine.class, ItemBlockHolder.class);
CoreRecipeLoader.blockOre = ModObjectRegistry.createNewBlock("DMBlockOre", DarkMain.MOD_ID, BlockOre.class, ItemBlockOre.class);
CoreRecipeLoader.blockWire = ModObjectRegistry.createNewBlock("DMBlockWire", DarkMain.MOD_ID, BlockWire.class, ItemBlockHolder.class);
CoreRecipeLoader.blockDebug = ModObjectRegistry.createNewBlock("DMBlockDebug", DarkMain.MOD_ID, BlockDebug.class, ItemBlockHolder.class);
@ -198,7 +197,7 @@ public class DarkMain extends ModPrefab
CoreRecipeLoader.blockColorSand = ModObjectRegistry.createNewBlock("DMBlockColorSand", DarkMain.MOD_ID, BlockColorSand.class, ItemBlockColored.class);
CoreRecipeLoader.blockBasalt = ModObjectRegistry.createNewBlock("DMBlockBasalt", DarkMain.MOD_ID, BlockBasalt.class, ItemBlockColored.class);
CoreRecipeLoader.blockGlowGlass = ModObjectRegistry.createNewBlock("DMBlockGlowGlass", DarkMain.MOD_ID, BlockColorGlowGlass.class, ItemBlockColored.class);
blockSolar = ModObjectRegistry.createNewBlock("DMBlockSolar", DarkMain.MOD_ID, BlockSolarPanel.class, ItemBlockHolder.class);
CoreRecipeLoader.blockSolar = ModObjectRegistry.createNewBlock("DMBlockSolar", DarkMain.MOD_ID, BlockSolarPanel.class, ItemBlockHolder.class);
/* ITEMS */
CoreRecipeLoader.itemTool = new ItemTools(ITEM_ID_PREFIX++, DarkMain.CONFIGURATION);
@ -219,7 +218,6 @@ public class DarkMain extends ModPrefab
{
CoreRecipeLoader.itemParts = new ItemParts(ITEM_ID_PREFIX++, CONFIGURATION);
CoreRecipeLoader.itemGlowingSand = new ItemColoredDust(CONFIGURATION.getItem(Configuration.CATEGORY_ITEM, "GlowingRefinedSandItemID", ITEM_ID_PREFIX++).getInt(), "GlowRefinedSand");
}
CONFIGURATION.save();
}

View file

@ -83,6 +83,11 @@ public enum EnumMaterial
return reStack;
}
public ItemStack getStack(EnumOrePart part, int ammount)
{
return getStack(this, part, ammount);
}
public static Icon getIcon(int metadata)
{
int mat = metadata / EnumMaterial.itemCountPerMaterial;