Package crazypants.util

Examples of crazypants.util.BlockCoord


      cb.clearCurrentMultiblock();
    }

    BlockCoord[] mb = new BlockCoord[blocks.size()];
    for (int i = 0; i < blocks.size(); i++) {
      mb[i] = new BlockCoord(blocks.get(i));
    }

    TileCapacitorBank secondary = blocks.get(1);
    maxInput = maxOutput = -1;
View Full Code Here


  private void findNighbouringBanks(TileCapacitorBank tileCapacitorBank, List<TileCapacitorBank> blocks) {
    if(isCreative || blocks.size() >= MAX_SIZE) {
      return;
    }
    BlockCoord bc = new BlockCoord(tileCapacitorBank);
    for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
      TileCapacitorBank cb = getCapBank(bc.getLocation(dir));
      if(cb != null && !blocks.contains(cb) && !cb.isCreative && !cb.isMaxSize()) {
        if(blocks.size() >= MAX_SIZE) {
          return;
        }
        blocks.add(cb);
View Full Code Here

    if(nbtRoot.getBoolean("isMultiblock")) {
      int[] coords = nbtRoot.getIntArray("multiblock");
      multiblock = new BlockCoord[coords.length / 3];
      int c = 0;
      for (int i = 0; i < multiblock.length; i++) {
        multiblock[i] = new BlockCoord(coords[c++], coords[c++], coords[c++]);
      }

    } else {
      multiblock = null;
    }
View Full Code Here

      //Make sure player not on the track and is in a safe position
      ForgeDirection railDir = EnderIO.blockEnderRail.getDirection(meta);
      int xOffset = Math.abs(railDir.offsetX);
      int zOffset = Math.abs(railDir.offsetZ);
      BlockCoord startPos = new BlockCoord(reciever).getLocation(ForgeDirection.UP);
      boolean foundSpot = false;
      for (int i = 1; i < 3 && !foundSpot; i++) {
        //try each side of the track
        playerToTP.setPosition(startPos.x + 0.5 - (xOffset * i), startPos.y, startPos.z + 0.5 - (zOffset * i));
        List<AxisAlignedBB> collides = EntityUtil.getCollidingBlockGeometry(reciever.getWorldObj(), playerToTP);
View Full Code Here

  public IHarvestResult harvestBlock(TileFarmStation farm, BlockCoord bc, Block block, int meta) {
    HarvestResult res = new HarvestResult();
    int y = bc.y;
    boolean done = false;
    while (!done && farm.hasTool(treeTap)) {
      bc = new BlockCoord(bc.x, y, bc.z);
      block = farm.getBlock(bc);
      if(!isWood(block)) {
        done = true;
      } else {
        meta = farm.getBlockMeta(bc);
View Full Code Here

      return null;
    }
   
    IHarvestResult res = new HarvestResult();   
   
    BlockCoord checkBlock = bc;
    for(int i=0; i < 5 && farm.hasHoe(); i++) {
      meta = farm.getBlockMeta(checkBlock);
      IHarvestResult blockRes = super.harvestBlock(farm, checkBlock, block, meta);
   
      if(blockRes != null) {      
        res.getHarvestedBlocks().add(checkBlock);
        List<EntityItem> addToDrops = blockRes.getDrops();
        for(EntityItem stack : addToDrops) {
          res.getDrops().add(stack);
        }
        farm.actionPerformed(false);
        farm.damageHoe(1, checkBlock);
      }
      checkBlock = checkBlock.getLocation(ForgeDirection.UP);
    }
   
    if(res.getHarvestedBlocks().isEmpty()) {
      return null;
    }   
View Full Code Here

  public boolean canHarvest(TileFarmStation farm, BlockCoord bc, Block block, int meta) {
    if(!Config.farmEssenceBerriesEnabled && "tile.ore.berries.two".equals(block.getUnlocalizedName()) && meta == grownBlockMeta) {
      return false;
    }
   
    BlockCoord checkBlock = bc;
   
    for(int i=0; i < 5; i++) {
      meta = farm.getBlockMeta(checkBlock);
      if(super.canHarvest(farm, checkBlock, block, meta)) {    
        return true;
      }
      checkBlock = checkBlock.getLocation(ForgeDirection.UP);
    }  
    return false;
  }
View Full Code Here

    }
    return false;
  }

  static boolean canPlaceBlockOnRightClick(EntityPlayer player, World world, int x, int y, int z, int side, int slot) {
    BlockCoord placeCoord = new BlockCoord(x, y, z).getLocation(ForgeDirection.getOrientation(side));
    ItemStack toUse = player.inventory.mainInventory[slot];
    AxisAlignedBB aabb;
    Block blk = Block.getBlockFromItem(toUse.getItem());
    if(blk != null) {
      aabb = blk.getCollisionBoundingBoxFromPool(world, placeCoord.x, placeCoord.y, placeCoord.z);
View Full Code Here

  private void updatePowersReceptors() {
    if(!receptorsDirty) {
      return;
    }
    receptors.clear();
    BlockCoord myLoc = new BlockCoord(this);
    for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
      BlockCoord checkLoc = myLoc.getLocation(dir);
      TileEntity te = worldObj.getTileEntity(checkLoc.x, checkLoc.y, checkLoc.z);
      IPowerInterface pi = PowerHandlerUtil.create(te);
      if(pi != null) {
        receptors.add(new Receptor(pi, dir));
      }
View Full Code Here

    if(!fluidHandlersDirty) {
      return;
    }
    fluidHandlers.clear();
    if(isConnected) {
      BlockCoord myLoc = new BlockCoord(this);
      for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
        BlockCoord checkLoc = myLoc.getLocation(dir);
        TileEntity te = worldObj.getTileEntity(checkLoc.x, checkLoc.y, checkLoc.z);
        if(te instanceof IFluidHandler && !(te instanceof TileHyperCube)) {
          IFluidHandler fh = (IFluidHandler) te;
          fluidHandlers.add(new NetworkFluidHandler(this, fh, dir));
        }
View Full Code Here

TOP

Related Classes of crazypants.util.BlockCoord

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.