Package mekanism.api

Examples of mekanism.api.ChanceOutput


  }

  @Override
  public void operate()
  {
    ChanceOutput output = RecipeHandler.getChanceOutput(inventory[0], true, getRecipes());

    if(inventory[0].stackSize <= 0)
    {
      inventory[0] = null;
    }

    if(output.hasPrimary())
    {
      if(inventory[2] == null)
      {
        inventory[2] = output.primaryOutput;
      }
      else {
        inventory[2].stackSize += output.primaryOutput.stackSize;
      }
    }

    if(output.hasSecondary() && output.checkSecondary())
    {
      if(inventory[4] == null)
      {
        inventory[4] = output.secondaryOutput;
      }
View Full Code Here


    if(inventory[0] == null)
    {
      return false;
    }

    ChanceOutput output = RecipeHandler.getChanceOutput(inventory[0], false, getRecipes());

    if(output == null)
    {
      return false;
    }

    if(output.hasPrimary())
    {
      if(inventory[2] != null)
      {
        if(!inventory[2].isItemEqual(output.primaryOutput))
        {
          return false;
        }
        else {
          if(inventory[2].stackSize + output.primaryOutput.stackSize > inventory[2].getMaxStackSize())
          {
            return false;
          }
        }
      }
    }

    if(output.hasSecondary())
    {
      if(inventory[4] != null)
      {
        if(!inventory[4].isItemEqual(output.secondaryOutput))
        {
View Full Code Here

        RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(new ItemStack(Blocks.obsidian), GasRegistry.getGas("hydrogenChloride")), new ItemStack(Shard, 4, 6));
        RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(new ItemStack(Blocks.dirt), GasRegistry.getGas("water")), new ItemStack(Blocks.clay));
        RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(new ItemStack(Items.gunpowder), GasRegistry.getGas("hydrogenChloride")), new ItemStack(Mekanism.Dust, 1, 10));
   
    //Precision Sawmill Recipes
    RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Blocks.ladder, 3), new ChanceOutput(new ItemStack(Items.stick, 7)));
    RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Blocks.chest), new ChanceOutput(new ItemStack(Blocks.planks, 8)));
    RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Blocks.trapdoor), new ChanceOutput(new ItemStack(Blocks.planks, 3)));
    RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Items.boat), new ChanceOutput(new ItemStack(Blocks.planks, 5)));
    RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Items.bed), new ChanceOutput(new ItemStack(Blocks.planks, 3), new ItemStack(Blocks.wool, 3), 1));
    RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Blocks.jukebox), new ChanceOutput(new ItemStack(Blocks.planks, 8), new ItemStack(Items.diamond), 1));
    RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Blocks.bookshelf), new ChanceOutput(new ItemStack(Blocks.planks, 6), new ItemStack(Items.book, 3), 1));
    RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Blocks.wooden_pressure_plate), new ChanceOutput(new ItemStack(Blocks.planks, 2)));
    RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Blocks.fence), new ChanceOutput(new ItemStack(Items.stick, 3)));
    RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Blocks.fence_gate), new ChanceOutput(new ItemStack(Blocks.planks, 2), new ItemStack(Items.stick, 4), 1));
    RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Blocks.noteblock), new ChanceOutput(new ItemStack(Blocks.planks, 8), new ItemStack(Items.redstone, 1), 1));
    RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Blocks.redstone_torch), new ChanceOutput(new ItemStack(Items.stick, 1), new ItemStack(Items.redstone), 1));
    RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Blocks.crafting_table), new ChanceOutput(new ItemStack(Blocks.planks, 4)));
   
        //Metallurgic Infuser Recipes
        RecipeHandler.addMetallurgicInfuserRecipe(InfusionInput.getInfusion(InfuseRegistry.get("CARBON"), 10, new ItemStack(Items.iron_ingot)), new ItemStack(EnrichedIron));
        RecipeHandler.addMetallurgicInfuserRecipe(InfusionInput.getInfusion(InfuseRegistry.get("CARBON"), 10, new ItemStack(EnrichedIron)), new ItemStack(Dust, 1, 5));
        RecipeHandler.addMetallurgicInfuserRecipe(InfusionInput.getInfusion(InfuseRegistry.get("REDSTONE"), 10, new ItemStack(Items.iron_ingot)), new ItemStack(EnrichedAlloy));
View Full Code Here

      {
        ItemStack wildStack = new ItemStack(ore.getItem(), 1, OreDictionary.WILDCARD_VALUE);
       
        if(!Recipe.PRECISION_SAWMILL.containsRecipe(wildStack))
        {
          RecipeHandler.addPrecisionSawmillRecipe(wildStack, new ChanceOutput(new ItemStack(Items.stick, 6), new ItemStack(Mekanism.Sawdust), 0.25));
        }
      }
      else {
        RecipeHandler.addPrecisionSawmillRecipe(StackUtils.size(ore, 1), new ChanceOutput(new ItemStack(Items.stick, 6), new ItemStack(Mekanism.Sawdust), 0.25));
      }
    }
   
    for(ItemStack ore : OreDictionary.getOres("oreNetherSteel"))
    {
      RecipeHandler.addEnrichmentChamberRecipe(StackUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 4, 5));
    }
   
    if(OreDictionary.getOres("itemRubber").size() > 0)
    {
      for(ItemStack ore : OreDictionary.getOres("woodRubber"))
      {
        RecipeHandler.addPrecisionSawmillRecipe(MekanismUtils.size(ore, 1), new ChanceOutput(new ItemStack(Blocks.planks, 4), MekanismUtils.size(OreDictionary.getOres("itemRubber").get(0), 1), 1F));
      }
    }
   
    for(ItemStack ore : OreDictionary.getOres("dustSulfur"))
    {
View Full Code Here

          tempCrafting.setInventorySlotContents(0, log);
          ItemStack resultEntry = MekanismUtils.findMatchingRecipe(tempCrafting, null);

          if(resultEntry != null)
          {
            RecipeHandler.addPrecisionSawmillRecipe(log, new ChanceOutput(StackUtils.size(resultEntry, 6), new ItemStack(Mekanism.Sawdust), 1));
          }
        }
      }
      else {
        ItemStack log = StackUtils.size(logEntry, 1);
        tempCrafting.setInventorySlotContents(0, log);
        ItemStack resultEntry = MekanismUtils.findMatchingRecipe(tempCrafting, null);

        if(resultEntry != null)
        {
          RecipeHandler.addPrecisionSawmillRecipe(log, new ChanceOutput(StackUtils.size(resultEntry, 6), new ItemStack(Mekanism.Sawdust), 1));
        }
      }
    }
  }
View Full Code Here

TOP

Related Classes of mekanism.api.ChanceOutput

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.