Package logisticspipes.transport

Examples of logisticspipes.transport.PipeFluidTransportLogistics


  }
 
  // BC copy, except where marked with XXX
  private void renderFluids(CoreUnroutedPipe pipe, double x, double y, double z) {
    // XXX PipeTransportFluids trans = pipe.transport;
    PipeFluidTransportLogistics trans = (PipeFluidTransportLogistics)(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(int i = 0; i < 6; ++i) {
      FluidStack fluidStack = trans.renderCache[i];
     
      if(fluidStack != null && fluidStack.amount > 0) {
        DisplayFluidList d = getListFromBuffer(fluidStack, pipe.container.getWorldObj());
       
        if(d == null) {
          continue;
        }
       
        // XXX int stage = (int) ((float) fluidStack.amount / (float) (trans.getCapacity()) * (LIQUID_STAGES - 1));
        int stage = (int)((float)fluidStack.amount / (float)(trans.getSideCapacity()) * (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);
        FluidRenderer.setColorForFluidStack(fluidStack);
        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) {
        // XXX int stage = (int) ((float) fluidStack.amount / (float) (trans.getCapacity()) * (LIQUID_STAGES - 1));
        int stage = (int)((float)fluidStack.amount / (float)(trans.getInnerCapacity()) * (LIQUID_STAGES - 1));
       
        bindTexture(TextureMap.locationBlocksTexture);
        FluidRenderer.setColorForFluidStack(fluidStack);
       
        if(above) {
View Full Code Here


      }
      if(!toRemove.isEmpty()) {
        localJamList.removeAll(toRemove);
      }
    }
    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();
     
View Full Code Here

public abstract class FluidRoutedPipe extends CoreRoutedPipe {

  private WorldUtil worldUtil;
 
  public FluidRoutedPipe(Item item) {
    super(new PipeFluidTransportLogistics(), item);
  }
View Full Code Here

TOP

Related Classes of logisticspipes.transport.PipeFluidTransportLogistics

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.