Package buildcraft.api.transport

Examples of buildcraft.api.transport.IPipeTile


  }

  @Override
  public boolean canConduitConnect(ForgeDirection direction) {   
    if(bcPower instanceof IPipeTile) {
      IPipeTile pipeTile = (IPipeTile) bcPower;
      return pipeTile.getPipeType() == PipeType.POWER;
    }
    return true;   
  }
View Full Code Here


      posPipe.moveForwards(1.0);

      TileEntity pipeEntry = world.getTileEntity((int) posPipe.x, (int) posPipe.y, (int) posPipe.z);

      if (pipeEntry instanceof IPipeTile) {
        IPipeTile pipe = (IPipeTile)pipeEntry;

        if (from != ForgeDirection.UNKNOWN && pipeEntry instanceof IPipeConnection) {
          if (((IPipeConnection) pipeEntry).overridePipeConnection(PipeType.ITEM, from) != ConnectOverride.DISCONNECT)
            possiblePipes.add(dir);
        } else if(pipe.getPipeType() == PipeType.ITEM && pipe.isPipeConnected(dir.getOpposite()))
          possiblePipes.add(dir);
      }
    }

    return possiblePipes.toArray(new ForgeDirection[0]);
View Full Code Here

    itemPos.moveForwards(0.5);

    Position pipePos = new Position(tile.xCoord, tile.yCoord, tile.zCoord, pipes.get(choice));
    pipePos.moveForwards(1.0);

    IPipeTile pipe = (IPipeTile) tile.getWorldObj().getTileEntity((int) pipePos.x, (int) pipePos.y, (int) pipePos.z);

    ItemStack payload = stack.splitStack(1);
    if(pipe.injectItem(payload, true, itemPos.orientation.getOpposite()) > 0)
      return true;
    else
      pipes.remove(choice);

    return false;
View Full Code Here

  @Override
  public boolean addItemsToPipe(TileEntity te, ItemStack is, ForgeDirection dir)
  {
    if ( is != null && te != null && te instanceof IPipeTile )
    {
      IPipeTile pt = (IPipeTile) te;
      if ( pt.getPipeType() == PipeType.ITEM )
      {
        int amt = pt.injectItem( is, false, dir );
        if ( amt == is.stackSize )
        {
          pt.injectItem( is, true, dir );
          return true;
        }
      }
    }
View Full Code Here

  public boolean canAddItemsToPipe(TileEntity te, ItemStack is, ForgeDirection dir)
  {

    if ( is != null && te != null && te instanceof IPipeTile )
    {
      IPipeTile pt = (IPipeTile) te;
      if ( pt.getPipeType() == PipeType.ITEM )
      {
        int amt = pt.injectItem( is, false, dir );
        if ( amt == is.stackSize )
        {
          return true;
        }
      }
View Full Code Here

      pos.moveForwards(1.0);

      TileEntity tile = world.getTileEntity((int) pos.x, (int) pos.y, (int) pos.z);

      if (tile instanceof IPipeTile) {
        IPipeTile pipe = (IPipeTile) tile;
        if (pipe.getPipeType() != PipeType.ITEM) {
          continue;
        }
        if (!pipe.isPipeConnected(side.getOpposite())) {
          continue;
        }

        possiblePipes.add(pipe);
        pipeDirections.add(side.getOpposite());
      }
    }

    if (possiblePipes.size() > 0) {
      int choice = RANDOM.nextInt(possiblePipes.size());

      IPipeTile pipeEntry = possiblePipes.get(choice);

      return pipeEntry.injectItem(stack, true, pipeDirections.get(choice));
    }
    return 0;
  }
View Full Code Here

TOP

Related Classes of buildcraft.api.transport.IPipeTile

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.