Package powercrystals.core.position

Examples of powercrystals.core.position.BlockPosition


  {
    if(world.isBlockIndirectlyGettingPowered(x, y, z))
    {
      return true;
    }
    for(BlockPosition bp : new BlockPosition(x, y, z).getAdjacent(false))
    {
      int blockId = world.getBlockId(bp.x, bp.y, bp.z);
      if(blockId == Block.redstoneWire.blockID && Block.blocksList[blockId].isProvidingStrongPower(world, bp.x, bp.y, bp.z, 1) > 0)
      {
        return true;
View Full Code Here


  public static Map<ForgeDirection, IPipeEntry> findPipes(World world, int x, int y, int z, ForgeDirection[] directionstocheck)
  {
    Map<ForgeDirection, IPipeEntry> pipes = new LinkedHashMap<ForgeDirection, IPipeEntry>();
    for(ForgeDirection direction : directionstocheck)
    {
      BlockPosition bp = new BlockPosition(x, y, z);
      bp.orientation = direction;
      bp.moveForwards(1);
      TileEntity te = world.getBlockTileEntity(bp.x, bp.y, bp.z);
      if(te instanceof IPipeEntry)
      {
        pipes.put(direction, (IPipeEntry)te);
      }
View Full Code Here

  public static Map<ForgeDirection, IInventory> findChests(World world, int x, int y, int z, ForgeDirection[] directionstocheck)
  {
    Map<ForgeDirection, IInventory> chests = new LinkedHashMap<ForgeDirection, IInventory>();
    for(ForgeDirection direction : directionstocheck)
    {
      BlockPosition bp = new BlockPosition(x, y, z);
      bp.orientation = direction;
      bp.moveForwards(1);
      TileEntity te = world.getBlockTileEntity(bp.x, bp.y, bp.z);
      if(te instanceof IInventory)
      {
        chests.put(direction, checkForDoubleChest(world, te, bp));
      }
View Full Code Here

   * Example of this behavior: Cargo dropoff rail, item collector.
   * @return  The remainder of the ItemStack. Whatever -wasn't- successfully dropped.
   */
  public static ItemStack dropStack(TileEntity from, ItemStack stack)
  {
    return dropStack(from.worldObj, new BlockPosition(from.xCoord, from.yCoord, from.zCoord), stack, ForgeDirection.VALID_DIRECTIONS, ForgeDirection.UNKNOWN);
  }
View Full Code Here

   * @param  airdropdirection  the direction that the stack may be dropped into air.
   * @return  The remainder of the ItemStack. Whatever -wasn't- successfully dropped.
   */
  public static ItemStack dropStack(TileEntity from, ItemStack stack, ForgeDirection airdropdirection)
  {
    return dropStack(from.worldObj, new BlockPosition(from.xCoord, from.yCoord, from.zCoord), stack, ForgeDirection.VALID_DIRECTIONS, airdropdirection);
  }
View Full Code Here

   * @return  The remainder of the ItemStack. Whatever -wasn't- successfully dropped.
   */
  public static ItemStack dropStack(TileEntity from, ItemStack stack, ForgeDirection dropdirection, ForgeDirection airdropdirection)
  {
    ForgeDirection[] dropdirections = {dropdirection};
    return dropStack(from.worldObj, new BlockPosition(from.xCoord, from.yCoord, from.zCoord), stack, dropdirections, airdropdirection);
  }
View Full Code Here

   * @param  airdropdirection  the direction that the stack may be dropped into air. ForgeDirection.UNKNOWN or other invalid directions indicate that stack shouldn't be dropped into the world.
   * @return  The remainder of the ItemStack. Whatever -wasn't- successfully dropped.
   */
  public static ItemStack dropStack(TileEntity from, ItemStack stack, ForgeDirection[] dropdirections, ForgeDirection airdropdirection)
  {
    return dropStack(from.worldObj, new BlockPosition(from.xCoord, from.yCoord, from.zCoord), stack, dropdirections, airdropdirection);
  }
View Full Code Here

   
    for(int i = 0; i < 6; i++)
    {
      if(!Arrays.areEqual(lastOuput[i], _buffers[i + 6]))
      {
        BlockPosition bp = new BlockPosition(this);
        bp.orientation = ForgeDirection.VALID_DIRECTIONS[i];
        bp.moveForwards(1);
        Block b = Block.blocksList[worldObj.getBlockId(bp.x, bp.y, bp.z)];
        if(b instanceof IRedNetNetworkContainer)
        {
          ((IRedNetNetworkContainer)b).updateNetwork(worldObj, bp.x, bp.y, bp.z);
        }
View Full Code Here

    }
  }
 
  public RedNetConnectionType getConnectionState(ForgeDirection side)
  {
    BlockPosition bp = new BlockPosition(this);
    bp.orientation = side;
    bp.moveForwards(1);
   
    int blockId = worldObj.getBlockId(bp.x, bp.y, bp.z);
    Block b = Block.blocksList[blockId];
   
    if(b == null) // block doesn't exist (air) - never connect
View Full Code Here

  }
 
  public void setNetwork(RedstoneNetwork network)
  {
    _network = network;
    _network.addCable(new BlockPosition(this));
  }
View Full Code Here

TOP

Related Classes of powercrystals.core.position.BlockPosition

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.