Package net.minecraftforge.fluids

Examples of net.minecraftforge.fluids.FluidStack.copy()


      requestSource.amount = amountPerRequest;
      for (ForgeDirection dir : con.getExternalConnections()) {
        if(con.canOutputToDir(dir)) {
          IFluidHandler extCon = con.getExternalHandler(dir);
          if(extCon != null) {
            int amount = extCon.fill(dir.getOpposite(), requestSource.copy(), true);
            if(amount > 0) {
              outputedToExternal(amount);
              tank.addAmount(-amount);
            }
          }
View Full Code Here


          if(filled)
          {
            if(structure.fluidStored == null)
            {
              structure.fluidStored = itemFluid.copy();
            }
            else {
              structure.fluidStored.amount += itemFluid.amount;
            }
           
View Full Code Here

    }
    PipeFluidTransportLogistics transport = (PipeFluidTransportLogistics) this.transport;
    for(ForgeDirection dir:ForgeDirection.VALID_DIRECTIONS) {
      FluidStack stack = transport.sideTanks[dir.ordinal()].getFluid();
      if(stack == null) continue;
      stack = stack.copy();
     
      if(nextSendMax[dir.ordinal()] > 0 && stack.amount < transport.sideTanks[dir.ordinal()].getCapacity()) {
        nextSendMax[dir.ordinal()]--;
        continue;
      }
View Full Code Here

          if(((LogisticsTileGenericPipe)pair.getValue1()).pipe instanceof CoreRoutedPipe) continue;
        }
        FluidTank tankSide = ((PipeFluidTransportLogistics)this.transport).sideTanks[pair.getValue2().ordinal()];
        stack = tank.getFluid();
        if(stack == null) continue;
        stack = stack.copy();
        int filled = tankSide.fill(stack , true);
        if(filled == 0) continue;
        FluidStack drain = tank.drain(filled, true);
        if(drain == null || filled != drain.amount) {
          if(LPConstants.DEBUG) {
View Full Code Here

        //Try to put liquid into all adjacent tanks.
        for (int i = 0; i < adjTanks.size(); i++) {
          Pair<TileEntity,ForgeDirection> pair = adjTanks.get(i);
          IFluidHandler tank = (IFluidHandler) pair.getValue1();
          ForgeDirection dir = pair.getValue2();
          filled = tank.fill(dir.getOpposite(), liquid.copy(), true);
          liquid.amount -= filled;
          if (liquid.amount != 0) continue;
          return true;
        }
        //Try inserting the liquid into the pipe side tank
View Full Code Here

    ForgeDirection orientation = data.output.getOpposite();
    if(getUpgradeManager().hasSneakyUpgrade()) {
      orientation = getUpgradeManager().getSneakyOrientation();
    }
    while (data.getItemIdentifierStack().getStackSize() > 0 && container.fill(orientation, liquidId, false) == liquidId.amount && this.useEnergy(5)) {
      container.fill(orientation, liquidId.copy(), true);
      data.getItemIdentifierStack().lowerStackSize(1);
      Item item = data.getItemIdentifierStack().getItem().item;
      if (item.hasContainerItem(data.getItemIdentifierStack().makeNormalStack())) {
        Item containerItem = item.getContainerItem();
        transport.sendItem(new ItemStack(containerItem, 1));
View Full Code Here

      if ( insert.amount > available )
        insert.amount = available;

      IFluidHandler tank = l.getTarget();
      if ( tank != null )
        l.tmpUsed = tank.fill( l.side.getOpposite(), insert.copy(), true );
      else
        l.tmpUsed = 0;

      available -= insert.amount;
      used += insert.amount;
View Full Code Here

          FluidStack drainable = handler.drain(station.side, FluidContainerRegistry.BUCKET_VOLUME, false);

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

            drainable = drainable.copy();

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

            if (filled > 0) {
              drainable.amount = filled;
View Full Code Here

          FluidStack drainable = robot.drain(ForgeDirection.UNKNOWN, FluidContainerRegistry.BUCKET_VOLUME,
              false);

          if (drainable != null) {
            drainable = drainable.copy();

            int filled = handler.fill(station.side, drainable, true);

            if (filled > 0) {
              drainable.amount = filled;
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.