コード例 #1
0
  private void onMonitorUpdate(final IMEMonitor<IAEFluidStack> monitor) {
    // Do we have a filter?
    if (this.filterAspect == null) {
      // Set the current amount to 0
      this.setCurrentAmount(0);
    }

    // Get the gas for the filter aspect
    GaseousEssentia aspectGas = GaseousEssentia.getGasFromAspect(this.filterAspect);

    // Is there a fluid form of the aspect?
    if (aspectGas == null) {
      // Set the current amount to 0
      this.setCurrentAmount(0);
    }

    // Convert to AE fluid stack
    IAEFluidStack asGasStack =
        EssentiaConversionHelper.instance.createAEFluidStackInFluidUnits(aspectGas, 1);

    // Get how much is in the system
    IAEFluidStack fluidStack = monitor.getStorageList().findPrecise(asGasStack);

    // Was there any in the system?
    if (fluidStack == null) {
      // Set current amount to zero
      this.setCurrentAmount(0);
    } else {
      // Set the current amount
      this.setCurrentAmount(
          EssentiaConversionHelper.instance.convertFluidAmountToEssentiaAmount(
              fluidStack.getStackSize()));
    }
  }
コード例 #2
0
  /** Gets the list of essentia gasses stored on the cell. */
  @Override
  public IItemList<IAEFluidStack> getAvailableItems(final IItemList<IAEFluidStack> availableList) {
    for (AspectStack essentiaStack : this.storedEssentia) {
      // Skip if null
      if (essentiaStack == null) {
        continue;
      }

      // Get the gas
      GaseousEssentia essentiaGas = GaseousEssentia.getGasFromAspect(essentiaStack.aspect);

      // Create the AE fluid stack
      availableList.add(
          EssentiaConversionHelper.INSTANCE.createAEFluidStackInEssentiaUnits(
              essentiaGas, essentiaStack.stackSize));
    }

    return availableList;
  }