Package crazypants.util

Examples of crazypants.util.BlockCoord


    return plantFromInventory(farm, bc);
  }

  @Override
  public boolean canHarvest(TileFarmStation farm, BlockCoord bc, Block block, int meta) {
    BlockCoord up = bc.getLocation(ForgeDirection.UP);
    Block upBLock = farm.getBlock(up);
    return upBLock == plantedBlock;
  }
View Full Code Here


  @Override
  public IHarvestResult harvestBlock(TileFarmStation farm, BlockCoord bc, Block block, int meta) {
       
   
    HarvestResult res = new HarvestResult();
    BlockCoord harvestCoord = bc;
    boolean done = false;
    do{
      harvestCoord = harvestCoord.getLocation(ForgeDirection.UP);
      if(plantedBlock == farm.getBlock(harvestCoord) && farm.hasHoe()) {
        res.harvestedBlocks.add(harvestCoord);
        ArrayList<ItemStack> drops = plantedBlock.getDrops(farm.getWorldObj(), harvestCoord.x, harvestCoord.y, harvestCoord.z, meta, farm.getMaxLootingValue());
        if(drops != null) {
          for(ItemStack drop : drops) {
View Full Code Here

    }
    clearNotification();
  }

  public boolean tillBlock(BlockCoord plantingLocation) {
    BlockCoord dirtLoc = plantingLocation.getLocation(ForgeDirection.DOWN);
    Block dirtBlock = getBlock(dirtLoc);
    if((dirtBlock == Blocks.dirt || dirtBlock == Blocks.grass)) {
      if(!hasHoe()) {
        setNotification(NOTIFICATION_NO_HOE);
        return false;
View Full Code Here

    }
    if("noPower".equals(notification)) {
      clearNotification();
    }

    BlockCoord bc = getNextCoord();
    if(bc != null && bc.equals(getLocation())) { //don't try and harvest ourselves
      bc = getNextCoord();
    }
    if(bc == null) {
      return;
    }
View Full Code Here

  private BlockCoord getNextCoord() {

    int size = getFarmSize();

    BlockCoord loc = getLocation();
    if(lastScanned == null) {
      lastScanned = new BlockCoord(loc.x - size, loc.y, loc.z - size);
      return lastScanned;
    }

    int nextX = lastScanned.x + 1;
    int nextZ = lastScanned.z;
    if(nextX > loc.x + size) {
      nextX = loc.x - size;
      nextZ += 1;
      if(nextZ > loc.z + size) {
        lastScanned = null;
        return getNextCoord();
      }
    }
    return new BlockCoord(nextX, lastScanned.y, nextZ);
  }
View Full Code Here

  @Override
  public void fromBytes(ByteBuf buffer) {
    int size = buffer.readInt();
    coords = new ArrayList<BlockCoord>(size);
    for (int i = 0; i < size; i++) {
      coords.add(new BlockCoord(buffer.readInt(), buffer.readInt(), buffer.readInt()));
    }
  }
View Full Code Here

            if(getConnectionMode(faceHit) == ConnectionMode.DISABLED) {
              setConnectionMode(faceHit, getNextConnectionMode(faceHit));
              return true;
            }

            BlockCoord loc = getLocation().getLocation(faceHit);
            ILiquidConduit n = ConduitUtil.getConduit(getBundle().getEntity().getWorldObj(), loc.x, loc.y, loc.z, ILiquidConduit.class);
            if(n == null) {
              return false;
            }
            if(!(n instanceof EnderLiquidConduit)) {
View Full Code Here

    }
    doExtract();
  }

  private void doExtract() {
    BlockCoord loc = getLocation();
    if(!hasConnectionMode(ConnectionMode.INPUT)) {
      return;
    }
    if(network == null) {
      return;
View Full Code Here

    }
    TileEntity te = bundle.getEntity();
    if(te == null) {
      return null;
    }
    return new BlockCoord(te.xCoord, te.yCoord, te.zCoord);
  }
View Full Code Here

            if(getConnectionMode(faceHit) == ConnectionMode.DISABLED) {
              setConnectionMode(faceHit, getNextConnectionMode(faceHit));
              return true;
            }

            BlockCoord loc = getLocation().getLocation(faceHit);
            ILiquidConduit n = ConduitUtil.getConduit(getBundle().getEntity().getWorldObj(), loc.x, loc.y, loc.z, ILiquidConduit.class);
            if(n == null) {
              return false;
            }
            if(!canJoinNeighbour(n)) {
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.