Package mekanism.api

Examples of mekanism.api.Coord4D


  @Override
  public int[] getBoundSlots(Coord4D location, int side)
  {
    ForgeDirection dir = ForgeDirection.getOrientation(facing).getOpposite();

    Coord4D eject = Coord4D.get(this).translate(dir.offsetX, 1, dir.offsetZ);
    Coord4D pull = Coord4D.get(this).translate(0, 1, 0);

    if((location.equals(eject) && side == dir.ordinal()) || (location.equals(pull) && side == 1))
    {
      if(EJECT_INV == null)
      {
View Full Code Here


  @Override
  public boolean canBoundInsert(Coord4D location, int i, ItemStack itemstack)
  {
    ForgeDirection side = ForgeDirection.getOrientation(facing).getOpposite();

    Coord4D eject = Coord4D.get(this).translate(side.offsetX, 1, side.offsetZ);
    Coord4D pull = Coord4D.get(this).translate(0, 1, 0);

    if(location.equals(eject))
    {
      return false;
    }
View Full Code Here

  @Override
  public boolean canBoundExtract(Coord4D location, int i, ItemStack itemstack, int j)
  {
    ForgeDirection side = ForgeDirection.getOrientation(facing).getOpposite();

    Coord4D eject = new Coord4D(xCoord+side.offsetX, yCoord+1, zCoord+side.offsetZ, worldObj.provider.dimensionId);
    Coord4D pull = new Coord4D(xCoord, yCoord+1, zCoord, worldObj.provider.dimensionId);

    if(location.equals(eject))
    {
      if(itemstack != null && replaceStack != null && itemstack.isItemEqual(replaceStack))
      {
View Full Code Here

    {
      height = 0;
      return false;
    }
   
    Coord4D startPoint = Coord4D.get(this).getFromSide(right);
    startPoint = isLeftOnFace ? startPoint.getFromSide(right) : startPoint;

    int middle = 0;
   
    Coord4D middlePointer = startPoint.getFromSide(ForgeDirection.DOWN);
   
    while(scanMiddleLayer(middlePointer))
    {
      middlePointer = middlePointer.getFromSide(ForgeDirection.DOWN);
      middle++;
    }
   
    if(height < 3 || height > 18 || middle != height-2)
    {
View Full Code Here

    for(int x = 0; x < 4; x++)
    {
      for(int z = 0; z < 4; z++)
      {
        Coord4D pointer = current.getFromSide(left, x).getFromSide(back, z);
       
        int corner = getCorner(x, z);
       
        if(corner != -1)
        {
          if(addSolarPanel(pointer.getTileEntity(worldObj), corner))
          {
            continue;
          }
          else if(!addTankPart(pointer.getTileEntity(worldObj)))
          {
            return false;
          }
        }
        else {
          if((x == 1 || x == 2) && (z == 1 || z == 2))
          {
            if(!pointer.isAirBlock(worldObj))
            {
              return false;
            }
          }
          else {
            TileEntity pointerTile = pointer.getTileEntity(worldObj);
           
            if(!addTankPart(pointerTile))
            {
              return false;
            }
View Full Code Here

    for(int x = 0; x < 4; x++)
    {
      for(int z = 0; z < 4; z++)
      {
        Coord4D pointer = current.getFromSide(left, x).getFromSide(back, z);
       
        if((x == 1 || x == 2) && (z == 1 || z == 2))
        {
          if(!pointer.isAirBlock(worldObj))
          {
            return false;
          }
        }
        else {
          TileEntity pointerTile = pointer.getTileEntity(worldObj);
         
          if(!addTankPart(pointerTile))
          {
            return false;
          }
View Full Code Here

  }

  public boolean scanBottomLayer()
  {
    height = 1;
    Coord4D baseBlock = Coord4D.get(this);
   
    while(baseBlock.getFromSide(ForgeDirection.DOWN).getTileEntity(worldObj) instanceof TileEntitySalinationTank)
    {
      baseBlock.step(ForgeDirection.DOWN);
      height++;
    }

    ForgeDirection left = MekanismUtils.getLeft(facing);
    ForgeDirection right = MekanismUtils.getRight(facing);

    if(!scanBottomRow(baseBlock))
    {
      return false;
    };
   
    if(!scanBottomRow(baseBlock.getFromSide(left)))
    {
      return false;
    };
   
    if(!scanBottomRow(baseBlock.getFromSide(right)))
    {
      return false;
    };

    boolean twoLeft = scanBottomRow(baseBlock.getFromSide(left).getFromSide(left));
    boolean twoRight = scanBottomRow(baseBlock.getFromSide(right).getFromSide(right));

    if(twoLeft == twoRight)
    {
      return false;
    }
View Full Code Here

   * @return
   */
  public boolean scanBottomRow(Coord4D start)
  {
    ForgeDirection back = MekanismUtils.getBack(facing);
    Coord4D current = start;

    for(int i = 1; i <= 4; i++)
    {
      TileEntity tile = current.getTileEntity(worldObj);
     
      if(!addTankPart(tile))
      {
        return false;
      }
     
      current = current.getFromSide(back);
    }

    return true;
  }
View Full Code Here

    {
      return null;
    }
   
    ForgeDirection right = MekanismUtils.getRight(facing);
    Coord4D startPoint = Coord4D.get(this).getFromSide(right);
    startPoint = isLeftOnFace ? startPoint.getFromSide(right) : startPoint;
   
    startPoint = startPoint.getFromSide(right.getOpposite()).getFromSide(MekanismUtils.getBack(facing));
    startPoint.translate(0, -(height-2), 0);
   
    return startPoint;
  }
View Full Code Here

          sendStructure = true;
        }

        for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
        {
          Coord4D obj = Coord4D.get(this).getFromSide(side);

          if(!obj.isAirBlock(worldObj) && !(obj.getTileEntity(worldObj) instanceof TileEntityDynamicTank))
          {
            obj.getBlock(worldObj).onNeighborChange(worldObj, obj.xCoord, obj.yCoord, obj.zCoord, xCoord, yCoord, zCoord);
          }
        }

        Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
      }
View Full Code Here

TOP

Related Classes of mekanism.api.Coord4D

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.