示例#1
0
  /**
   * Whether or not this PressurizedReactants's GasStack entry's gas type is equal to the gas type
   * of the given gas.
   *
   * @param stack - stack to check
   * @return if the stack's gas type is contained in this PressurizedReactants
   */
  public boolean containsType(GasStack stack) {
    if (stack == null || stack.amount == 0) {
      return false;
    }

    return stack.isGasEqual(theGas);
  }
  @Override
  public int receiveGas(ForgeDirection side, GasStack stack) {
    if (canReceiveGas(side, stack.getGas())) {
      return injectTank.receive(stack, true);
    }

    return 0;
  }
  public boolean canOperate() {
    if (inventory[1] == null) {
      return false;
    }

    GasStack stack =
        RecipeHandler.getItemToGasOutput(
            inventory[1], false, Recipe.CHEMICAL_DISSOLUTION_CHAMBER.get());

    if (stack == null
        || (outputTank.getGas() != null
            && (outputTank.getGas().getGas() != stack.getGas()
                || outputTank.getNeeded() < stack.amount))) {
      return false;
    }

    return true;
  }
示例#4
0
 @Override
 public void load(NBTTagCompound nbtTags) {
   theSolid = ItemStack.loadItemStackFromNBT(nbtTags.getCompoundTag("itemInput"));
   theFluid = FluidStack.loadFluidStackFromNBT(nbtTags.getCompoundTag("fluidInput"));
   theGas = GasStack.readFromNBT(nbtTags.getCompoundTag("gasInput"));
 }
示例#5
0
 @Override
 public int hashIngredients() {
   return StackUtils.hashItemStack(theSolid) << 16
       | (theFluid.getFluid() != null ? theFluid.getFluid().hashCode() : 0) << 8
       | theGas.hashCode();
 }
示例#6
0
 @Override
 public PressurizedInput copy() {
   return new PressurizedInput(theSolid.copy(), theFluid.copy(), theGas.copy());
 }