Package powercrystals.core.position

Examples of powercrystals.core.position.BlockPosition


      if(_inventory[i] == null || !(_inventory[i].getItem() instanceof ItemBlock))
      {
        continue;
      }
     
      BlockPosition bp = BlockPosition.fromFactoryTile(this);
      bp.moveForwards(1);
      if(worldObj.isAirBlock(bp.x, bp.y, bp.z))
      {
        worldObj.setBlock(bp.x, bp.y, bp.z, _inventory[i].itemID, _inventory[i].getItemDamage(), 3);
        Block block = Block.blocksList[_inventory[i].itemID];
        worldObj.playSoundEffect(bp.x + 0.5, bp.y + 0.5, bp.z + 0.5,
View Full Code Here


        setWorkDone(0);
      }
     
      if(_tick >= 23)
      {
        Area a = new Area(new BlockPosition(this), 3, 3, 3);
        List<?> entities = worldObj.getEntitiesWithinAABB(EntityLiving.class, a.toAxisAlignedBB());
        for(Object o : entities)
        {
          if(o instanceof EntityPlayer)
          {
View Full Code Here

        continue;
      }
      EntityAgeable a = (EntityAgeable)o;
      if((a.getGrowingAge() < 0 && !_moveOld) || (a.getGrowingAge() >= 0 && _moveOld))
      {
        BlockPosition bp = BlockPosition.fromFactoryTile(this);
        bp.moveBackwards(1);
        a.setPosition(bp.x + 0.5, bp.y + 0.5, bp.z + 0.5);
       
        return true;
      }
    }
View Full Code Here

  }
 
  public BlockPosition getNextBlock()
  {
    checkRecalculate();
    BlockPosition next = _harvestedBlocks.get(_currentBlock);
    _currentBlock++;
    if(_currentBlock >= _harvestedBlocks.size())
    {
      _currentBlock = 0;
    }
View Full Code Here

    }
  }
 
  private void recalculateArea()
  {
    BlockPosition ourpos = BlockPosition.fromFactoryTile(_owner);
    if(_overrideDirection != ForgeDirection.UNKNOWN)
    {
      ourpos.orientation = _overrideDirection;
    }
   
    _originX = ourpos.x + _originOffsetX;
    _originY = ourpos.y + _originOffsetY;
    _originZ = ourpos.z + _originOffsetZ;
    _originOrientation = ourpos.orientation;
   
    int radius = _radius + _upgradeLevel;
   
    if(ourpos.orientation == ForgeDirection.UP || ourpos.orientation == ForgeDirection.DOWN)
    {
      ourpos.moveForwards(1);
    }
    else
    {
      ourpos.moveForwards(radius + 1);
    }
   
    ourpos.x += _originOffsetX;
    ourpos.y += _originOffsetY;
    ourpos.z += _originOffsetZ;
View Full Code Here

{
  private static HashMap<BlockPosition, NBTTagCompound> _blockNbtData = new HashMap<BlockPosition, NBTTagCompound>();
 
  public static void setForBlock(BlockPosition bp, NBTTagCompound tag)
  {
    BlockPosition newbp = bp.copy();
    newbp.orientation = ForgeDirection.UNKNOWN;
    _blockNbtData.put(bp, tag);
  }
View Full Code Here

      return;
    }
    NBTTagCompound tag = new NBTTagCompound();
    te.writeToNBT(tag);
   
    setForBlock(new BlockPosition(te), tag);
  }
View Full Code Here

    setForBlock(new BlockPosition(te), tag);
  }
 
  public static NBTTagCompound getForBlock(int x, int y, int z)
  {
    BlockPosition bp = new BlockPosition(x, y, z, ForgeDirection.UNKNOWN);
    NBTTagCompound tag = _blockNbtData.get(bp);
    _blockNbtData.remove(bp);
    return tag;
  }
View Full Code Here

  }
 
  @Override
  public boolean activateMachine()
  {
    BlockPosition bp = _areaManager.getNextBlock();
   
    ItemStack match = _inventory[getPlanterSlotIdFromBp(bp)];
   
    for(int stackIndex = 10; stackIndex <= 25; stackIndex++)
    {   
View Full Code Here

  }
 
  @Override
  public boolean activateMachine()
  {
    BlockPosition bp = _areaManager.getNextBlock();
   
    int targetId = worldObj.getBlockId(bp.x, bp.y, bp.z);
    if(!MFRRegistry.getFertilizables().containsKey(new Integer(targetId)))
    {
      setIdleTicks(getIdleTicksMax());
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.