Package erogenousbeef.bigreactors.api.data

Examples of erogenousbeef.bigreactors.api.data.SourceProductMapping


    if(oreDictNames == null || oreDictNames.size() < 1) {
      BRLog.warning("Reactants.registerSolid: Could not resolve ore dict name for %s", itemStack.getUnlocalizedName());
      return null;
    }

    SourceProductMapping firstMapping = null;

    for(String name : oreDictNames) {
      OreDictToReactantMapping mapping = new OreDictToReactantMapping(name, reactantName);
      SourceProductMapping reverseMapping = mapping.getReverse();
      _solidToReactant.put(mapping.getSource(), mapping);
      mapReactant(reverseMapping.getSource(), reverseMapping, _reactantToSolid);

      if(firstMapping == null) { firstMapping = mapping; }
    }
   
    return firstMapping;
View Full Code Here


    if(oreDictNames == null || oreDictNames.size() < 1) {
      BRLog.warning("Reactants.registerSolid: Could not resolve ore dict name for %s", itemStack.getUnlocalizedName());
      return null;
    }

    SourceProductMapping firstMapping = null;

    for(String name : oreDictNames) {
      OreDictToReactantMapping mapping = new OreDictToReactantMapping(name, reactantName, reactantQty);
      SourceProductMapping reverseMapping = mapping.getReverse();
      _solidToReactant.put(mapping.getSource(), mapping);
      mapReactant(reverseMapping.getSource(), reverseMapping, _reactantToSolid);

      if(firstMapping == null) { firstMapping = mapping; }
    }
   
    return firstMapping;   
View Full Code Here

   
    OreDictToReactantMapping mapping = new OreDictToReactantMapping(oreDictName, reactantName, reactantAmount);
   
    _solidToReactant.put(mapping.getSource(), mapping);
   
    SourceProductMapping reverseMapping = mapping.getReverse();
    mapReactant(reverseMapping.getSource(), reverseMapping, _reactantToSolid);
    return mapping;
  }
View Full Code Here

    if(!_reactants.containsKey(reactantName)) {
      throw new IllegalArgumentException("Unknown reactantName " + reactantName);
    }
   
    OreDictToReactantMapping mapping = new OreDictToReactantMapping(oreDictName, reactantName);
    SourceProductMapping reverseMapping = mapping.getReverse();
   
    _solidToReactant.put(mapping.getSource(), mapping);
    mapReactant(reverseMapping.getSource(), reverseMapping, _reactantToSolid);
    return mapping;
  }
View Full Code Here

    if(!_reactants.containsKey(reactantName)) {
      throw new IllegalArgumentException("Unknown reactantName " + reactantName);
    }

    FluidToReactantMapping mapping = new FluidToReactantMapping(fluidStack, reactantName);
    SourceProductMapping reverseMapping = mapping.getReverse();

    _fluidToReactant.put(mapping.getSource(), mapping);
    mapReactant(reverseMapping.getSource(), reverseMapping, _reactantToFluid);
  }
View Full Code Here

    if(!_reactants.containsKey(reactantName)) {
      throw new IllegalArgumentException("Unknown reactantName " + reactantName);
    }

    FluidToReactantMapping mapping = new FluidToReactantMapping(fluid, reactantName);
    SourceProductMapping reverseMapping = mapping.getReverse();

    _fluidToReactant.put(mapping.getSource(), mapping);
    mapReactant(reverseMapping.getSource(), reverseMapping, _reactantToFluid);
  }
View Full Code Here

   * based on its ore dictionary entry.
   * @param stack The item stack to query.
   * @return The name of the reactant represented by this item stack, or null.
   */
  public static String getReactantName(ItemStack stack) {
    SourceProductMapping mapping = getSolidToReactant(stack);
    return mapping != null ? mapping.getProduct() : null;
  }
View Full Code Here

  // Return the name of the reactant to which the item in the input slot
  public String getInputReactantType() {
    ItemStack inputItem = getStackInSlot(SLOT_INLET);
    if(inputItem == null) { return null; }
    SourceProductMapping mapping = Reactants.getSolidToReactant(inputItem);
    return mapping != null ? mapping.getProduct() : null;
  }
View Full Code Here

  // Returns the potential amount of reactant which can be produced from this port.
  public int getInputReactantAmount() {
    ItemStack inputItem = getStackInSlot(SLOT_INLET);
    if(inputItem == null) { return 0; }

    SourceProductMapping mapping = Reactants.getSolidToReactant(inputItem);
    return mapping != null ? mapping.getProductAmount(inputItem.stackSize) : 0;
  }
View Full Code Here

   */
  public int consumeReactantItem(int reactantDesired) {
    ItemStack inputItem = getStackInSlot(SLOT_INLET);
    if(inputItem == null) { return 0; }
   
    SourceProductMapping mapping = Reactants.getSolidToReactant(inputItem);
    if(mapping == null) { return 0; }
   
    int sourceItemsToConsume = Math.min(inputItem.stackSize, mapping.getSourceAmount(reactantDesired));
   
    if(sourceItemsToConsume <= 0) { return 0; }

    decrStackSize(SLOT_INLET, sourceItemsToConsume);
    return mapping.getProductAmount(sourceItemsToConsume);
  }
View Full Code Here

TOP

Related Classes of erogenousbeef.bigreactors.api.data.SourceProductMapping

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.