Package crazypants.util

Examples of crazypants.util.BlockCoord


      powerPerTick = Config.attractorPowerPerTickLevelOne;
      break;
    }
    rangeSqu = range * range;

    BoundingBox bb = new BoundingBox(new BlockCoord(this));
    bb = bb.scale(range, range, range);
    attractorBounds = AxisAlignedBB.getBoundingBox(bb.minX, bb.minY, bb.minZ, bb.maxX, bb.maxY, bb.maxZ);
    capacitor = new BasicCapacitor(powerPerTick * 8, capacitorType.capacitor.getMaxEnergyStored(), powerPerTick);
  }
View Full Code Here


    EntityAIBase remove = null;
    boolean isTracked;
    for (EntityAITaskEntry entry : entries) {
      if(entry.action instanceof AttractTask) {
        AttractTask at = (AttractTask) entry.action;
        if(at.coord.equals(new BlockCoord(this)) || !at.continueExecuting()) {
          remove = entry.action;
        } else {
          return false;
        }
      }
    }
    if(remove != null) {
      ent.tasks.removeTask(remove);
    }
    cancelCurrentTasks(ent);
    ent.tasks.addTask(0, new AttractTask(ent, getTarget(), new BlockCoord(this)));
   
    return true;
  }
View Full Code Here

    }
    xSize = getXSize();
    ySize = getYSize();
    int x = getXSize() - 5 - BUTTON_SIZE;
    int y = 5;
    redstoneButton = new RedstoneModeButton(this, -1, x, y, tileEntity, new BlockCoord(tileEntity));

    y += 19;
    configB = new IconButtonEIO(this, CONFIG_ID, x, y, IconEIO.IO_CONFIG_UP);
    configB.setToolTip(Lang.localize("gui.machine.ioMode.overlay.tooltip"));
View Full Code Here

  private void doSelection(Vector3d start, Vector3d end) {
    start.add(origin);
    end.add(origin);
    List<MovingObjectPosition> hits = new ArrayList<MovingObjectPosition>();
    for (ViewableBlocks ug : blocks) {
      if(!ug.bc.equals(new BlockCoord(ioX, ioY, ioZ))) {
        MovingObjectPosition res = player.worldObj.rayTraceBlocks(Vec3.createVectorHelper(start.x, start.y, start.z),
            Vec3.createVectorHelper(end.x, end.y, end.z), false);

        if(res != null) {
          hits.add(res);
View Full Code Here

    BlockCoord bc;
    Block block;

    private ViewableBlocks(int x, int y, int z, Block block) {
      super();
      this.bc = new BlockCoord(x, y, z);
      this.block = block;
    }
View Full Code Here

    if(te instanceof TileCapacitorBank) {
      TileCapacitorBank cb = (TileCapacitorBank) te;
      cb.addEnergy(PowerHandlerUtil.getStoredEnergyForItem(stack));
      if(player instanceof EntityPlayer) {
        for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
          BlockCoord bc = new BlockCoord(x, y, z);
          bc = bc.getLocation(dir);
          te = world.getTileEntity(bc.x, bc.y, bc.z);
          if(te instanceof TileCapacitorBank) {
            if(((TileCapacitorBank)te).isMaxSize()) {
              ((EntityPlayer)player).addChatComponentMessage(new ChatComponentText("Capacitor bank is at maximum size"));
            }           
View Full Code Here

    }
  }
 
  private IWirelessCharger findNearestCharger() {
    int minDist = Integer.MAX_VALUE;
    BlockCoord charger = null;
    Map<BlockCoord, IWirelessCharger> map = WirelessChargerController.instance.getChargerMap(worldObj);
   
    if (map == null) {
      return null;
    }
   
    for (BlockCoord b : map.keySet()) {
      int dist = b.distance(new BlockCoord(this));
      if (dist < minDist) {
        minDist = dist;
        charger = b;
      }
    }

    if (charger != null && minDist < Config.wirelessChargerRange) {
      TileEntity te = charger.getTileEntity(worldObj);
      if (te instanceof IWirelessCharger) {
        return (IWirelessCharger) te;
      }
    }
   
View Full Code Here

      if(te.parentX != xCoord || te.parentY != yCoord || te.parentZ != zCoord) {
        // its somebody else's so leave it alone
        return;
      }
    }
    result.add(new NodeEntry(new BlockCoord(x, y, z), isDiag));
  }
View Full Code Here

    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

    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

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.