Package net.minecraftforge.fluids

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


            + dir.offsetY, station.z()
            + dir.offsetZ);

        if (nearbyTile != null && nearbyTile instanceof IFluidHandler) {
          IFluidHandler handler = (IFluidHandler) nearbyTile;
          FluidStack drainable = handler.drain(station.side, 1, false);

          // TODO: there is no account taken for the filter on the
          // gate here. See LoadFluid, GotoStationToLoad and Load for
          // items as well.
          if (drainable != null
View Full Code Here


      if (tile instanceof IFluidHandler) {
        IFluidHandler fluidHandler = (IFluidHandler) tile;

        int flowRate = transport.flowRate;

        FluidStack extracted = fluidHandler.drain(side.getOpposite(), liquidToExtract > flowRate ? flowRate : liquidToExtract, false);

        int inserted = 0;
        if (extracted != null) {
          inserted = transport.fill(side, extracted, true);
View Full Code Here

        int inserted = 0;
        if (extracted != null) {
          inserted = transport.fill(side, extracted, true);

          fluidHandler.drain(side.getOpposite(), inserted, true);
        }

        liquidToExtract -= inserted;
      }
    }
View Full Code Here

            + dir.offsetY, station.z()
            + dir.offsetZ);

        if (nearbyTile != null && nearbyTile instanceof IFluidHandler) {
          IFluidHandler handler = (IFluidHandler) nearbyTile;
          FluidStack drainable = handler.drain(station.side, FluidContainerRegistry.BUCKET_VOLUME, false);

          if (drainable != null
              && filter.matches(drainable.getFluid())) {

            drainable = drainable.copy();
View Full Code Here

            int filled = robot.fill(ForgeDirection.UNKNOWN, drainable, true);

            if (filled > 0) {
              drainable.amount = filled;
              handler.drain(station.side, drainable, true);
              loaded += filled;
              return;
            }
          }
        }
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.