Examples of drain()


Examples of javax.sound.sampled.TargetDataLine.drain()

        // write to the output
        sourceDataLine.write(bOutputBuffer, 0, bOutputBuffer.length);
      }
     
      // release all audio resources
      targetDataLine.drain();
      targetDataLine.close();
      sourceDataLine.drain();
      sourceDataLine.close();
    }
  }
View Full Code Here

Examples of mods.railcraft.common.fluids.TankManager.drain()

    @Override
    public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
        TankManager tMan = getTankManager();
        if (tMan != null) {
            return tMan.drain(from, maxDrain, doDrain);
        }
        return null;
    }

    @Override
View Full Code Here

Examples of mods.railcraft.common.fluids.TankToolkit.drain()

        for (EntityMinecart cart : carts) {
            if (cart instanceof IFluidHandler) {
                TankToolkit tank = new TankToolkit((IFluidHandler) cart);
                boolean liquidMatches = false;
                Fluid filterFluid = getFilterLiquid();
                FluidStack tankLiquid = tank.drain(ForgeDirection.UNKNOWN, 1, false);
                if (filterFluid == null)
                    liquidMatches = true;
                else if (Fluids.areEqual(filterFluid, tankLiquid))
                    liquidMatches = true;
                else if (tank.canPutFluid(ForgeDirection.UNKNOWN, new FluidStack(filterFluid, 1)))
View Full Code Here

Examples of mods.railcraft.common.fluids.tanks.StandardTank.drain()

                        FluidStack fillStack = liquid.copy();
                        fillStack.amount = FluidHelper.BUCKET_VOLUME - (tankBelow.getCapacity() - liquid.amount);
                        if (fillStack.amount > 0) {
                            int used = tank.fill(fillStack, false);
                            if (used > 0) {
                                fillStack = tankBelow.drain(used, true);
                                tank.fill(fillStack, true);
                            }
                        }
                    }
                } else
View Full Code Here

Examples of net.minecraftforge.fluids.FluidTank.drain()

        FluidTank tank = ((PipeFluidTransportLogistics)this.transport).sideTanks[pair.getValue2().ordinal()];
        validDirections++;
        if(tank.getFluid() == null) continue;
        int filled = ((IFluidHandler)pair.getValue1()).fill(pair.getValue2().getOpposite(), tank.getFluid().copy(), true);
        if(filled == 0) continue;
        FluidStack drain = tank.drain(filled, true);
        if(drain == null || filled != drain.amount) {
          if(LPConstants.DEBUG) {
            throw new UnsupportedOperationException("Fluid Multiplication");
          }
        }
View Full Code Here

Examples of net.minecraftforge.fluids.IFluidBlock.drain()

      } else {
        return null;
      }
    } else if (bId instanceof IFluidBlock) {
      IFluidBlock block = (IFluidBlock) bId;
      return block.drain(world, x, y, z, true);
    }
    return null;
  }

  public static Fluid lookupFluidForBlock(Block block) {
View Full Code Here

Examples of net.minecraftforge.fluids.IFluidContainerItem.drain()

    if(fluid != null && item.getFluid(container).getFluid() != fluid)
    {
      return null;
    }
   
    return item.drain(container, needed, true);
  }
 
  public static int insertFluid(FluidTank tileTank, ItemStack container)
  {
    return insertFluid(tileTank.getFluid(), container);
View Full Code Here

Examples of net.minecraftforge.fluids.IFluidHandler.drain()

        for (FluidTankInfo info : infos) {
          if(info.fluid != null && info.fluid.amount > 0) {
            if(into.canFill(fromDir, info.fluid.getFluid())) {
              FluidStack canPull = info.fluid.copy();
              canPull.amount = Math.min(maxVolume, canPull.amount);
              FluidStack drained = target.drain(fromDir.getOpposite(), canPull, false);
              if(drained != null && drained.amount > 0) {
                int filled = into.fill(fromDir, drained, false);
                if(filled > 0) {
                  drained = target.drain(fromDir.getOpposite(), filled, true);
                  into.fill(fromDir, drained, true);
View Full Code Here

Examples of net.sourceforge.processdash.util.DrainableExecutor.drain()

            extDirNames.add(newPath);
            executor.execute(new ArchiveDirectoryTask(executor, out, instr,
                    newPath));
        }

        executor.drain();

        if (exceptionEncountered != null)
            throw exceptionEncountered;
    }
View Full Code Here

Examples of org.apache.avro.io.ResolvingDecoder.drain()

  @SuppressWarnings("unchecked")
  public D read(D reuse, Decoder in) throws IOException {
    ResolvingDecoder resolver = getResolver(actual, expected);
    resolver.configure(in);
    D result = (D) read(reuse, expected, resolver);
    resolver.drain();
    return result;
  }
 
  /** Called to read data.*/
  protected Object read(Object old, Schema expected,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.