Package logisticspipes.utils.tuples

Examples of logisticspipes.utils.tuples.LPPosition


  }

  private class LaserBeamDataClient extends LaserBeamData {
    public LaserBeamDataClient(float length, int timeout, boolean reverse, ForgeDirection dir, int color) {
      super(length, timeout, reverse);
      this.entity = new PipeFXLaserPowerBeam(pipe.getWorldObj(), new LPPosition((TileEntity)pipe), length, dir, color, LogisticsTileRenderController.this.pipe).setReverse(reverse);
      Minecraft.getMinecraft().effectRenderer.addEffect(this.entity);
     
    }
View Full Code Here


  }

  private class LaserBallDataClient extends LaserBallData {
    public LaserBallDataClient(float length, int timeout, int color) {
      super(length, timeout);
      this.entity = new PipeFXLaserPowerBall(pipe.getWorldObj(), new LPPosition((TileEntity)pipe), color, LogisticsTileRenderController.this.pipe);
      Minecraft.getMinecraft().effectRenderer.addEffect(this.entity);
    }
View Full Code Here

  @Override
  public List<TileEntity> getConnections(TileEntity tile) {
    boolean onlyOnePipe = false;
    for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
      LPPosition p = new LPPosition(tile);
      p.moveForward(direction);
      TileEntity canidate = p.getTileEntity(tile.getWorldObj());
      if(canidate instanceof LogisticsTileGenericPipe && MainProxy.checkPipesConnections(tile, canidate, direction)) {
        if(onlyOnePipe) {
          onlyOnePipe = false;
          break;
        } else {
          onlyOnePipe = true;
        }
      }
    }
    if(!onlyOnePipe || !SimpleServiceLocator.enderIOProxy.isSendAndReceive(tile)) {
      return new ArrayList<TileEntity>(0);
    }
    List<? extends TileEntity> connections = SimpleServiceLocator.enderIOProxy.getConnectedHyperCubes(tile);
    List<TileEntity> list = new ArrayList<TileEntity>();
    for(TileEntity connected:connections) {
      if(!SimpleServiceLocator.enderIOProxy.isSendAndReceive(connected)) continue;
      LogisticsTileGenericPipe pipe = null;
      for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
        LPPosition p = new LPPosition(connected);
        p.moveForward(direction);
        TileEntity canidate = p.getTileEntity(tile.getWorldObj());
        if(canidate instanceof LogisticsTileGenericPipe && MainProxy.checkPipesConnections(connected, canidate, direction)) {
          if(pipe != null) {
            pipe = null;
            break;
          } else {
View Full Code Here

  @Override
  public List<TileEntity> getConnections(TileEntity tile) {
    boolean onlyOnePipe = false;
    for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
      LPPosition p = new LPPosition(tile);
      p.moveForward(direction);
      TileEntity canidate = p.getTileEntity(tile.getWorldObj());
      if(canidate instanceof LogisticsTileGenericPipe && MainProxy.checkPipesConnections(tile, canidate, direction)) {
        if(onlyOnePipe) {
          onlyOnePipe = false;
          break;
        } else {
          onlyOnePipe = true;
        }
      }
    }
    if(!onlyOnePipe) {
      return new ArrayList<TileEntity>(0);
    }
    List<? extends TileEntity> connections = SimpleServiceLocator.thermalExpansionProxy.getConnectedTesseracts(tile);
    connections.remove(tile);
    List<TileEntity> list = new ArrayList<TileEntity>();
    for(TileEntity connected:connections) {
      LogisticsTileGenericPipe pipe = null;
      for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
        LPPosition p = new LPPosition(connected);
        p.moveForward(direction);
        TileEntity canidate = p.getTileEntity(tile.getWorldObj());
        if(canidate instanceof LogisticsTileGenericPipe && MainProxy.checkPipesConnections(connected, canidate, direction)) {
          if(pipe != null) {
            pipe = null;
            break;
          } else {
View Full Code Here

      checkType();
    } else if(type.equals("CoreRoutedPipe")) {
      int x = nbt.getInteger("X");
      int y = nbt.getInteger("Y");
      int z = nbt.getInteger("Z");
      final LPPosition pos = new LPPosition(x, y, z);
      final int dim = nbt.getInteger("Dim");
      QueuedTasks.queueTask(new Callable<Object>() {
        @Override
        public Object call() throws Exception {
          World world = DimensionManager.getWorld(dim);
          if(world != null) {
            TileEntity tile = pos.getTileEntity(world);
            if(tile instanceof LogisticsTileGenericPipe && ((LogisticsTileGenericPipe)tile).pipe instanceof CoreRoutedPipe) {
              object = ((LogisticsTileGenericPipe)tile).pipe;
              checkType();
            }
          }
View Full Code Here

  public void save(NBTTagCompound nbt) {
    if(object == null) return;
    if(object instanceof LPGlobalCCAccess) {
      nbt.setString("Type", "LPGlobalCCAccess");
    } else if(object instanceof CoreRoutedPipe) {
      LPPosition pos = ((CoreRoutedPipe)object).getLPPosition();
      nbt.setString("Type", "CoreRoutedPipe");
      nbt.setInteger("Dim", MainProxy.getDimensionForWorld(((CoreRoutedPipe)object).getWorld()));
      nbt.setInteger("X", pos.getX());
      nbt.setInteger("Y", pos.getY());
      nbt.setInteger("Z", pos.getZ());
    } else if(object instanceof CCItemIdentifierImplementation) {
      nbt.setString("Type", "CCItemIdentifierImplementation");
      ((CCItemIdentifierImplementation)object).getObject().makeNormalStack(1).writeToNBT(nbt);
    } else if(object instanceof CCItemIdentifierStackImplementation) {
      nbt.setString("Type", "CCItemIdentifierStackImplementation");
View Full Code Here

    for(LPTravelingItem item: pipe.transport.items) {
      if(count >= MAX_ITEMS_TO_RENDER) {
        break;
      }
     
      LPPosition pos = new LPPosition(0.5D, 0.5D, 0.5D);
     
      if(item.getPosition() > 1 || item.getPosition() < 0) {
        continue;
      }
     
      float fPos = item.getPosition() + item.getSpeed() * f;
     
      if(fPos < 0.5) {
        if(item.input == ForgeDirection.UNKNOWN) continue;
        if(!pipe.container.renderState.pipeConnectionMatrix.isConnected(item.input.getOpposite())) continue;
        pos.moveForward(item.input.getOpposite(), 0.5F - fPos);
      } else {
        if(item.output == ForgeDirection.UNKNOWN) continue;
        if(!pipe.container.renderState.pipeConnectionMatrix.isConnected(item.output)) continue;
        pos.moveForward(item.output, fPos - 0.5F);
      }
     
      if(item == null || item.getItemIdentifierStack() == null) continue;
      if(item.getContainer().xCoord != pipe.container.xCoord || item.getContainer().yCoord != pipe.container.yCoord || item.getContainer().zCoord != pipe.container.zCoord) continue;
      ItemStack itemstack = item.getItemIdentifierStack().makeNormalStack();
      doRenderItem(itemstack, x + pos.getXD(), y + pos.getYD(), z + pos.getZD(), light, item.getAge(), item.getHoverStart(), 0.7F);
      count++;
    }
    count = 0;
    float dist = 0.135F;
    LPPosition pos = new LPPosition(0.5D, 0.5D, 0.5D);
    pos.moveForward(ForgeDirection.SOUTH, dist);
    pos.moveForward(ForgeDirection.EAST, dist);
    pos.moveForward(ForgeDirection.UP, dist);
    for(Pair<ItemIdentifierStack, Pair<Integer, Integer>> item: pipe.transport._itemBuffer) {
      if(item == null || item.getValue1() == null) continue;
      ItemStack itemstack = item.getValue1().makeNormalStack();
      doRenderItem(itemstack, x + pos.getXD(), y + pos.getYD(), z + pos.getZD(), light, 0, 0, 0.25F);
      count++;
      if(count >= 27) {
        break;
      } else if(count % 9 == 0) {
        pos.moveForward(ForgeDirection.SOUTH, dist * 2);
        pos.moveForward(ForgeDirection.EAST, dist * 2);
        pos.moveForward(ForgeDirection.DOWN, dist);       
      } else if(count % 3 == 0) {
        pos.moveForward(ForgeDirection.SOUTH, dist * 2);
        pos.moveForward(ForgeDirection.WEST, dist);
      } else {
        pos.moveForward(ForgeDirection.NORTH, dist);
      }
    }
   
    GL11.glEnable(2896 /* GL_LIGHTING */);
    GL11.glPopMatrix();
 
View Full Code Here

        } else {
          //TODO is this needed ClientSide ?
          //bcItem = TravelingItem.make();
          return true;
        }
        LPPosition p = new LPPosition(tile.xCoord + 0.5F, tile.yCoord + CoreConstants.PIPE_MIN_POS, tile.zCoord + 0.5F);
        if(item.output.getOpposite() == ForgeDirection.DOWN) {
          p.moveForward(item.output.getOpposite(), 0.24F);
        } else if(item.output.getOpposite() == ForgeDirection.UP) {
          p.moveForward(item.output.getOpposite(), 0.74F);
        } else {
          p.moveForward(item.output.getOpposite(), 0.49F);
        }
        bcItem.setPosition(p.getXD(), p.getYD(), p.getZD());
        bcItem.setSpeed(item.getSpeed());
        if(item.getItemIdentifierStack() != null) {
          bcItem.setItemStack(item.getItemIdentifierStack().makeNormalStack());
        }
        ((PipeTransportItems)pipe.pipe.transport).injectItem(bcItem, item.output);
View Full Code Here

   */
  public IRouter readIRouter(World world) throws IOException {
    if(in.read() == 0) {
      return null;
    } else {
      LPPosition pos = this.readLPPosition();
      TileEntity tile = pos.getTileEntity(world);
      if(tile instanceof LogisticsTileGenericPipe && ((LogisticsTileGenericPipe)tile).pipe instanceof CoreRoutedPipe) {
        return ((CoreRoutedPipe)((LogisticsTileGenericPipe)tile).pipe).getRouter();
      }
      return null;
    }
View Full Code Here

      return null;
    }
  }

  public LPPosition readLPPosition() throws IOException {
    return new LPPosition(this.readDouble(), this.readDouble(), this.readDouble());
  }
View Full Code Here

TOP

Related Classes of logisticspipes.utils.tuples.LPPosition

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.