Package buildcraft.transport

Examples of buildcraft.transport.PipeTransportFluids


*/
public class PipeFluidsBalance extends ABOPipe<PipeTransportFluids> {
  private final int blockTexture = 5 * 16 + 0;

  public PipeFluidsBalance(int itemID) {
    super(new PipeTransportFluids(), itemID);

    transport.flowRate = 160;
    transport.travelDelay = 1;
  }
View Full Code Here


public class PipeFluidsDistribution extends ABOPipe<PipeTransportFluids> implements IClientState, IFluidSlotChange {

  public final Fluid[] fluids = new Fluid[6 * 9];

  public PipeFluidsDistribution(int itemID) {
    super(new PipeTransportFluids(), itemID);

    transport.flowRate = 160;
    transport.travelDelay = 2;
  }
View Full Code Here

  public PipeFluidsPump(int itemID) {
    this(itemID, Block.waterStill);
  }

  public PipeFluidsPump(int itemID, Block liquidStill) {
    super(new PipeTransportFluids(), itemID);
    liquid = liquidStill;

    transport.flowRate = 80;
    transport.travelDelay = 4;
  }
View Full Code Here

      return false;
    }
  };

  public PipeFluidsGoldenIron(int itemID) {
    super(new PipeTransportFluids(), itemID);

    transport.flowRate = 80;
    transport.travelDelay = 2;
  }
View Full Code Here

import buildcraft.transport.PipeTransportFluids;

public class PipeFluidsVoid extends Pipe<PipeTransportFluids> implements IPipeTransportFluidsHook {

  public PipeFluidsVoid(Item item) {
    super(new PipeTransportFluids(), item);

        transport.initFromPipe(getClass());
    transport.travelDelay = 12;
  }
View Full Code Here

    GL11.glPopAttrib();
    GL11.glPopMatrix();
  }

  private void renderFluids(Pipe<PipeTransportFluids> pipe, double x, double y, double z) {
    PipeTransportFluids trans = pipe.transport;

    boolean needsRender = false;
    for (int i = 0; i < 7; ++i) {
      FluidStack fluidStack = trans.renderCache[i];
      if (fluidStack != null && fluidStack.amount > 0) {
        needsRender = true;
        break;
      }
    }

    if (!needsRender) {
      return;
    }

    GL11.glPushMatrix();
    GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
    GL11.glEnable(GL11.GL_CULL_FACE);
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

    GL11.glTranslatef((float) x, (float) y, (float) z);

    // sides

    boolean sides = false, above = false;

    for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) {
      int i = side.ordinal();

      FluidStack fluidStack = trans.renderCache[i];

      if (fluidStack == null || fluidStack.amount <= 0) {
        continue;
      }

      if (!pipe.container.isPipeConnected(side)) {
        continue;
      }

      DisplayFluidList d = getListFromBuffer(fluidStack, pipe.container.getWorldObj());

      if (d == null) {
        continue;
      }

      int stage = (int) ((float) fluidStack.amount / (float) (trans.getCapacity()) * (LIQUID_STAGES - 1));

      GL11.glPushMatrix();
      int list = 0;

      switch (ForgeDirection.VALID_DIRECTIONS[i]) {
        case UP:
          above = true;
          list = d.sideVertical[stage];
          break;
        case DOWN:
          GL11.glTranslatef(0, -0.75F, 0);
          list = d.sideVertical[stage];
          break;
        case EAST:
        case WEST:
        case SOUTH:
        case NORTH:
          sides = true;
          // Yes, this is kind of ugly, but was easier than transform the coordinates above.
          GL11.glTranslatef(0.5F, 0.0F, 0.5F);
          GL11.glRotatef(angleY[i], 0, 1, 0);
          GL11.glRotatef(angleZ[i], 0, 0, 1);
          GL11.glTranslatef(-0.5F, 0.0F, -0.5F);
          list = d.sideHorizontal[stage];
          break;
        default:
      }
      bindTexture(TextureMap.locationBlocksTexture);
      RenderUtils.setGLColorFromInt(trans.colorRenderCache[i]);
      GL11.glCallList(list);
      GL11.glPopMatrix();
    }
    // CENTER
    FluidStack fluidStack = trans.renderCache[ForgeDirection.UNKNOWN.ordinal()];

    if (fluidStack != null && fluidStack.amount > 0) {
      DisplayFluidList d = getListFromBuffer(fluidStack, pipe.container.getWorldObj());

      if (d != null) {
        int stage = (int) ((float) fluidStack.amount / (float) (trans.getCapacity()) * (LIQUID_STAGES - 1));

        bindTexture(TextureMap.locationBlocksTexture);
        RenderUtils.setGLColorFromInt(trans.colorRenderCache[ForgeDirection.UNKNOWN.ordinal()]);

        if (above) {
View Full Code Here

import buildcraft.transport.PipeTransportFluids;

public class PipeFluidsGold extends Pipe<PipeTransportFluids> {

  public PipeFluidsGold(Item item) {
      super(new PipeTransportFluids(), item);

        transport.initFromPipe(getClass());
    transport.travelDelay = 4;
  }
View Full Code Here

        } else {
          return !transportItems.items.isEmpty();
        }
      }
    } else if (pipe.transport instanceof PipeTransportFluids) {
      PipeTransportFluids transportFluids = (PipeTransportFluids) pipe.transport;

      FluidStack searchedFluid = null;

      if (parameter != null && parameter.getItemStack() != null) {
        searchedFluid = FluidContainerRegistry.getFluidForFilledItem(parameter.getItemStack());
      }

      if (kind == PipeContents.empty) {
        for (FluidTankInfo b : transportFluids.getTankInfo(ForgeDirection.UNKNOWN)) {
          if (b.fluid != null && b.fluid.amount != 0) {
            return false;
          }
        }

        return true;
      } else {
        for (FluidTankInfo b : transportFluids.getTankInfo(ForgeDirection.UNKNOWN)) {
          if (b.fluid != null && b.fluid.amount != 0) {
            if (searchedFluid == null || searchedFluid.isFluidEqual(b.fluid)) {
              return true;
            }
          }
View Full Code Here

    if (!(pipe.pipe.transport instanceof PipeTransportFluids)) {
      return;
    }

    PipeTransportFluids transLiq = (PipeTransportFluids) pipe.pipe.transport;

    renderCache = transLiq.renderCache;
    colorRenderCache = transLiq.colorRenderCache;

    byte[] dBytes = new byte[2];
    data.readBytes(dBytes);
    delta = BitSetUtils.fromByteArray(dBytes);

    // System.out.printf("read %d, %d, %d = %s, %s%n", posX, posY, posZ, Arrays.toString(dBytes), delta);

    for (ForgeDirection dir : ForgeDirection.values()) {
      if (delta.get(dir.ordinal() * FLUID_DATA_NUM + FLUID_ID_BIT)) {
          int amt = renderCache[dir.ordinal()] != null ? renderCache[dir.ordinal()].amount : 0;
        renderCache[dir.ordinal()] = new FluidStack(data.readShort(), amt);
        colorRenderCache[dir.ordinal()] = data.readInt();
      }
      if (delta.get(dir.ordinal() * FLUID_DATA_NUM + FLUID_AMOUNT_BIT)) {
          if (renderCache[dir.ordinal()] == null) {
          renderCache[dir.ordinal()] = new FluidStack(0, 0);
          }
            renderCache[dir.ordinal()].amount = Math.min(transLiq.getCapacity(), data.readInt());
      }
    }
  }
View Full Code Here

      return tile instanceof IFluidHandler;
    }
  };

  public PipeFluidsIron(Item item) {
    super(new PipeTransportFluids(), item);

        transport.initFromPipe(getClass());
    transport.travelDelay = 8;
  }
View Full Code Here

TOP

Related Classes of buildcraft.transport.PipeTransportFluids

Copyright © 2018 www.massapicom. 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.