Examples of BlockCoord


Examples of crazypants.util.BlockCoord

    }
  }

  public double getScaleForCandidate(Vector3d loc) {

    BlockCoord bc = new BlockCoord((int) loc.x, (int) loc.y, (int) loc.z);
    float ratio = -1;
    Float r = candidates.get(bc);
    if(r != null) {
      ratio = r;
    }
View Full Code Here

Examples of crazypants.util.BlockCoord

    if(world != null && player != null) {
      int x = MathHelper.floor_double(player.posX);
      int y = MathHelper.floor_double(player.boundingBox.minY) - 1;
      int z = MathHelper.floor_double(player.posZ);
      if(world.getBlock(x, y, z) == EnderIO.blockTravelPlatform) {
        return new BlockCoord(x, y, z);
      }
    }
    return null;
  }
View Full Code Here

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

Examples of crazypants.util.BlockCoord

    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

Examples of crazypants.util.BlockCoord

    }
    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

Examples of crazypants.util.BlockCoord

  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

Examples of crazypants.util.BlockCoord

    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

Examples of crazypants.util.BlockCoord

    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

Examples of crazypants.util.BlockCoord

    }
  }
 
  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

Examples of crazypants.util.BlockCoord

      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
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.