Package net.minecraft.util

Examples of net.minecraft.util.AxisAlignedBB


  }
 
  // Called in Block.collisionRayTrace.
  public MovingObjectPosition rayTrace(World world, int x, int y, int z, Vec3 start, Vec3 end) {
   
    AxisAlignedBB aabb = tileEntity.getBlockType().getCollisionBoundingBoxFromPool(world, x, y, z);
    MovingObjectPosition target = aabb.calculateIntercept(start, end);
    EntityPlayer player = playerLocal.get();
   
    double distance = ((target != null) ? start.distanceTo(target.hitVec) : Double.MAX_VALUE);
    for (Attachment attachment : this) {
      if (!attachment.boxVisible(player)) continue;
      AxisAlignedBB attachmentBox = attachment.getHighlightBox();
      MovingObjectPosition attachmentTarget = attachmentBox.calculateIntercept(start, end);
      if (attachmentTarget == null) continue;
      double attachmentDistance = start.distanceTo(attachmentTarget.hitVec);
      if (attachmentDistance >= distance) continue;
      distance = attachmentDistance;
      target = attachmentTarget;
View Full Code Here


        int persistance = BetterStorageEnchantment.getLevel(lock, "persistance");
        if (breakProgress > 100 * (1 + persistance)) {
          int unbreaking = EnchantmentHelper.getEnchantmentLevel(Enchantment.unbreaking.effectId, lock);
          lock.setItemDamage(lock.getItemDamage() + 10 / (1 + unbreaking));
          if (lock.getItemDamage() < lock.getMaxDamage()) {
            AxisAlignedBB box = getHighlightBox();
            double x = (box.minX + box.maxX) / 2;
            double y = (box.minY + box.maxY) / 2;
            double z = (box.minZ + box.maxZ) / 2;
            EntityItem item = WorldUtils.spawnItem(tileEntity.getWorldObj(), x, y, z, lock);
          }
View Full Code Here

  @SideOnly(Side.CLIENT)
  public void hit(boolean damage) {
    wiggleStrength = Math.min(20.0F, wiggleStrength + 12.0F);
    if (damage) {
      hit = 10;
      AxisAlignedBB box = getHighlightBox();
      double x = (box.minX + box.maxX) / 2;
      double y = (box.minY + box.maxY) / 2;
      double z = (box.minZ + box.maxZ) / 2;
      tileEntity.getWorldObj().playSound(x, y, z, "random.break", 0.5F, 2.5F, false);
    }
View Full Code Here

      boolean success = keyType.unlock(holding, lock, true);
      lockType.onUnlock(lock, holding, lockable, player, success);
      if (!success) return true;
     
      if (player.isSneaking()) {
        AxisAlignedBB box = getHighlightBox();
        double x = (box.minX + box.maxX) / 2;
        double y = (box.minY + box.maxY) / 2;
        double z = (box.minZ + box.maxZ) / 2;
        EntityItem item = WorldUtils.spawnItem(player.worldObj, x, y, z, lock);
        lockable.setLock(null);
View Full Code Here

      return storedData;

    if (housing.getOwnerName() == null)
      return storedData;

    AxisAlignedBB hurtBox = getBounding(genome, housing, 1.0f);
    @SuppressWarnings("rawtypes")
    List list = housing.getWorld().getEntitiesWithinAABB(EntityMob.class, hurtBox);

    for (Object obj : list) {
      EntityMob mob = (EntityMob) obj;
View Full Code Here

  public IEffectData doEffect(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {

    if (isHalted(storedData, housing))
      return storedData;

    AxisAlignedBB beatifyBox = getBounding(genome, housing, 1.0f);
    @SuppressWarnings("rawtypes")
    List list = housing.getWorld().getEntitiesWithinAABB(EntityPlayer.class, beatifyBox);

    for (Object obj : list) {
      EntityPlayer player = (EntityPlayer) obj;
View Full Code Here

  @Override
  public IEffectData doEffect(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
    if (isHalted(storedData, housing))
      return storedData;

    AxisAlignedBB bounding = getBounding(genome, housing, 1.0f);
    @SuppressWarnings("rawtypes")
    List list = housing.getWorld().getEntitiesWithinAABB(EntityItem.class, bounding);

    if (list.size() > 0)
      Collections.shuffle(resurrectables);
View Full Code Here

    // Radioactivity hurts players and mobs
    Vect min = new Vect(housing.getXCoord() + offset.x, housing.getYCoord() + offset.y, housing.getZCoord() + offset.z);
    Vect max = new Vect(housing.getXCoord() + offset.x + area.x, housing.getYCoord() + offset.y + area.y, housing.getZCoord() + offset.z + area.z);

    AxisAlignedBB hurtBox = AxisAlignedBB.getBoundingBox(min.x, min.y, min.z, max.x, max.y, max.z);

    @SuppressWarnings("rawtypes")
    List list = housing.getWorld().getEntitiesWithinAABB(EntityLivingBase.class, hurtBox);

    for (Object obj : list) {
View Full Code Here

  public IEffectData doEffect(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {

    if (isHalted(storedData, housing))
      return storedData;

    AxisAlignedBB hurtBox = getBounding(genome, housing, 1.0f);
    @SuppressWarnings("rawtypes")
    List list = housing.getWorld().getEntitiesWithinAABB(EntityMob.class, hurtBox);

    for (Object obj : list) {
      EntityMob mob = (EntityMob) obj;
View Full Code Here

    Vect offset = new Vect(housing.getOffset());

    Vect min = coords.add(offset);
    Vect max = coords.add(offset).add(area);

    AxisAlignedBB harvestBox = AxisAlignedBB.getBoundingBox(min.x, min.y, min.z, max.x, max.y, max.z);
    List<Entity> list = housing.getWorld().getEntitiesWithinAABB(Entity.class, harvestBox);

    int i;
    for (i = 0; i < list.size(); i++) {
      Entity entity = list.get(i);
View Full Code Here

TOP

Related Classes of net.minecraft.util.AxisAlignedBB

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.