Examples of moveForwards()


Examples of buildcraft.api.core.Position.moveForwards()

          continue;
        }

        Position entityPos = new Position(tile.xCoord + 0.5, tile.yCoord + 0.5, tile.zCoord + 0.5, side.getOpposite());

        entityPos.moveForwards(0.6);

        TravelingItem entity = makeItem(entityPos.x, entityPos.y, entityPos.z, stack);

        transport.injectItem(entity, entityPos.orientation);
      }
View Full Code Here

Examples of buildcraft.api.core.Position.moveForwards()

  public boolean onItemUse(ItemStack stack, EntityPlayer player, World worldObj, int x, int y, int z, int side, float hitX, float hitY, float hitZ) {
    if (worldObj.isRemote) {
      return false;
    }
    Position pos = new Position(x, y, z, ForgeDirection.getOrientation(side));
    pos.moveForwards(1.0);

    TileEntity tile = worldObj.getTileEntity((int) pos.x, (int) pos.y, (int) pos.z);
    if (!(tile instanceof TileGenericPipe)) {
      return false;
    }
View Full Code Here

Examples of buildcraft.api.core.Position.moveForwards()

      return;
    }
   
    Position p = new Position(container.xCoord, container.yCoord,
        container.zCoord, event.direction);
    p.moveForwards(1.0);

    ItemStack stack = event.entity.getEntityItem();
    EntityPlayer player = CoreProxy.proxy.getBuildCraftPlayer((WorldServer) getWorld(),
        (int) p.x, (int) p.y, (int) p.z).get();
   
View Full Code Here

Examples of buildcraft.api.core.Position.moveForwards()

        }
        stack.getItem().onItemUse(new ItemStack(stack.getItem(), 1, stack.getItemDamage()),
            player, getWorld(), (int) p.x, (int) p.y, (int) p.z, 1, 0, 0, 0
          );
        stack.stackSize--;
        p.moveForwards(1.0);
        moves++;
      }
      if (getWorld().getBlock((int) p.x, (int) p.y, (int) p.z) != Blocks.air) {
        p.moveBackwards(1.0);
        stack.stackSize++;
View Full Code Here

Examples of buildcraft.api.core.Position.moveForwards()

 
  @Override
  public void dropItem(ItemStack itemStack, ForgeDirection direction) {
    Position p = new Position(container.xCoord, container.yCoord,
        container.zCoord, direction);
    p.moveForwards(1.0);

    itemStack.tryPlaceItemIntoWorld(CoreProxy.proxy.getBuildCraftPlayer((WorldServer) getWorld()).get(),
        getWorld(), (int) p.x, (int) p.y, (int) p.z, 1, 0.0f, 0.0f,
        0.0f);
  }
View Full Code Here

Examples of buildcraft.api.core.Position.moveForwards()

    ForgeDirection o = getOpenOrientation();

    if (o != ForgeDirection.UNKNOWN) {
      Position p = new Position(container.xCoord, container.yCoord,
          container.zCoord, o);
      p.moveForwards(1.0);

      if (!BlockUtil.isUnbreakableBlock(getWorld(), (int) p.x, (int) p.y, (int) p.z)) {
        Block block = getWorld().getBlock((int) p.x, (int) p.y, (int) p.z);
        int metadata = getWorld().getBlockMetadata((int) p.x, (int) p.y, (int) p.z);
       
View Full Code Here

Examples of buildcraft.api.core.Position.moveForwards()

      if (getItemStack().stackSize <= 0) {
        return null;
      }

      Position motion = new Position(0, 0, 0, output);
      motion.moveForwards(0.1 + getSpeed() * 2F);

      ItemStack stack = getItemStack();
      EntityItem entity = new EntityItem(container.getWorldObj(), xCoord, yCoord, zCoord, getItemStack());
      entity.lifespan = BuildCraftCore.itemLifespan;
      entity.delayBeforeCanPickup = 10;
View Full Code Here

Examples of buildcraft.api.core.Position.moveForwards()

   */
  public static int addToRandomInventoryAround(World world, int x, int y, int z, ItemStack stack) {
    Collections.shuffle(directions);
    for (ForgeDirection orientation : directions) {
      Position pos = new Position(x, y, z, orientation);
      pos.moveForwards(1.0);

      TileEntity tileInventory = world.getTileEntity((int) pos.x, (int) pos.y, (int) pos.z);
      ITransactor transactor = Transactor.getTransactorFor(tileInventory);
      if (transactor != null && !(tileInventory instanceof TileEngine) && transactor.add(stack, orientation.getOpposite(), false).stackSize > 0) {
        return transactor.add(stack, orientation.getOpposite(), true).stackSize;
View Full Code Here

Examples of buildcraft.api.core.Position.moveForwards()

        continue;
      }

      Position pos = new Position(x, y, z, side);

      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;
View Full Code Here

Examples of buildcraft.api.core.Position.moveForwards()

  }

  public static TileEntity getTile(World world, Position pos, ForgeDirection step) {
    Position tmp = new Position(pos);
    tmp.orientation = step;
    tmp.moveForwards(1.0);

    return world.getTileEntity((int) tmp.x, (int) tmp.y, (int) tmp.z);
  }

  public static IAreaProvider getNearbyAreaProvider(World world, int i, int j, int k) {
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.