Examples of BlockCoord


Examples of crazypants.util.BlockCoord

    if(evt.getPlayer().isSneaking() && isEquipped(evt.getPlayer()) && isLog(evt.block, evt.blockMetadata)) {
      int powerStored = getStoredPower(evt.getPlayer());
   
      TreeHarvestUtil harvester = new TreeHarvestUtil();
      HarvestResult res = new HarvestResult();
      BlockCoord bc = new BlockCoord(evt.x, evt.y, evt.z);
      harvester.harvest(evt.getPlayer().worldObj, bc, res);
     
      List<BlockCoord> sortedTargets = new ArrayList<BlockCoord>(res.getHarvestedBlocks());
      harvestComparator.refPoint = bc;
      Collections.sort(sortedTargets, harvestComparator);
View Full Code Here

Examples of crazypants.util.BlockCoord

    this.configurables.addAll(configurables);

    Vector3d c;
    Vector3d size;
    if(configurables.size() == 1) {
      BlockCoord bc = configurables.get(0);
      c = new Vector3d(bc.x + 0.5, bc.y + 0.5, bc.z + 0.5);
      size = new Vector3d(1,1,1);
    } else {
      Vector3d min = new Vector3d(Double.MAX_VALUE,Double.MAX_VALUE,Double.MAX_VALUE);
      Vector3d max = new Vector3d(-Double.MAX_VALUE,-Double.MAX_VALUE,-Double.MAX_VALUE);
      for(BlockCoord bc : configurables) {
        min.set(Math.min(bc.x, min.x),Math.min(bc.y, min.y),Math.min(bc.z, min.z));
        max.set(Math.max(bc.x, max.x),Math.max(bc.y, max.y),Math.max(bc.z, max.z));
      }
      size = new Vector3d(max);
      size.sub(min);
      size.scale(0.5);
      c = new Vector3d(min.x + size.x, min.y + size.y,min.z + size.z);
      size.scale(2);
    }

    originBC = new BlockCoord((int) c.x, (int) c.y, (int) c.z);
    origin.set(c);
    pitchRot.setIdentity();
    yawRot.setIdentity();

    pitch = -mc.thePlayer.rotationPitch;
    yaw = 180 - mc.thePlayer.rotationYaw;

    distance = Math.max(Math.max(size.x, size.y), size.z) + 4;

    for(BlockCoord bc : configurables) {
      for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
        BlockCoord loc = bc.getLocation(dir);
        if(!configurables.contains(loc)) {
          neighbours.add(loc);
        }
      }
    }
View Full Code Here

Examples of crazypants.util.BlockCoord

      this.coord = coord;
      this.isDiagnal = isDiagnal;
    }

    NodeEntry(TileLightNode node) {
      coord = new BlockCoord(node);
      isDiagnal = node.isDiagnal;
    }
View Full Code Here

Examples of crazypants.util.BlockCoord

      return false;
    }

    @Override
    public boolean isAirBlock(int var1, int var2, int var3) {
      if(!configurables.contains(new BlockCoord(var1,var2,var3))) {
        return false;
      }
      return super.isAirBlock(var1, var2, var3);
    }
View Full Code Here

Examples of crazypants.util.BlockCoord

      return 15 << 20 | 15 << 4;
    }

    @Override
    public Block getBlock(int var1, int var2, int var3) {
      if(!configurables.contains(new BlockCoord(var1,var2,var3))) {
        return Blocks.air;
      }
      return super.getBlock(var1, var2, var3);
    }
View Full Code Here

Examples of crazypants.util.BlockCoord

    }

    boolean res = super.doPush(dir);
    if(tank.getFluidAmount() > 0) {

      BlockCoord loc = getLocation().getLocation(dir);
      IFluidHandler target = FluidUtil.getFluidHandler(worldObj, loc);
      if(target != null) {
        if(target.canFill(dir.getOpposite(), tank.getFluid().getFluid())) {
          FluidStack push = tank.getFluid().copy();
          push.amount = Math.min(push.amount, IO_MB_TICK);
View Full Code Here

Examples of crazypants.util.BlockCoord

      return false;
    }

    boolean res = super.doPull(dir);
    if(tank.getFluidAmount() < tank.getCapacity()) {
      BlockCoord loc = getLocation().getLocation(dir);
      IFluidHandler target = FluidUtil.getFluidHandler(worldObj, loc);
      if(target != null) {

        if(tank.getFluidAmount() > 0) {
          FluidStack canPull = tank.getFluid().copy();
View Full Code Here

Examples of crazypants.util.BlockCoord

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

Examples of crazypants.util.BlockCoord

  }

  //private PowerDistributor powerDis;
  private boolean transmitEnergy() {
    if(powerDis == null) {
      powerDis = new PowerDistributor(new BlockCoord(this));
    }
    int canTransmit = Math.min(getEnergyStored(), getPowerUsePerTick() * 2);
    if(canTransmit <= 0) {
      return false;
    }
View Full Code Here

Examples of crazypants.util.BlockCoord

      tankNeighbours = new ArrayList<TankNeighbour>();
    }
    tankNeighbours.clear();
    for (BlockCoord bc : multiblock) {
      for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
        BlockCoord check = bc.getLocation(dir);
        if(!inMultiblock(check)) {
          IFluidHandler tc = getTankContainer(check);
          if(tc != null) {
            tankNeighbours.add(new TankNeighbour(tc, dir.getOpposite()));
          }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.