Пример #1
0
  protected void onEntityRemoved(Entity par1Entity) {
    super.onEntityRemoved(par1Entity);
    this.entityIdMap.removeObject(par1Entity.entityId);
    Entity[] var2 = par1Entity.getParts();

    if (var2 != null) {
      for (int var3 = 0; var3 < var2.length; ++var3) {
        this.entityIdMap.removeObject(var2[var3].entityId);
      }
    }
  }
Пример #2
0
  protected void onEntityAdded(Entity par1Entity) {
    super.onEntityAdded(par1Entity);
    this.entityIdMap.addKey(par1Entity.entityId, par1Entity);
    Entity[] var2 = par1Entity.getParts();

    if (var2 != null) {
      for (int var3 = 0; var3 < var2.length; ++var3) {
        this.entityIdMap.addKey(var2[var3].entityId, var2[var3]);
      }
    }
  }
Пример #3
0
  /**
   * Fills the given list of all entities that intersect within the given bounding box that aren't
   * the passed entity Args: entity, aabb, listToFill
   */
  public void getEntitiesWithinAABBForEntity(
      Entity par1Entity,
      AxisAlignedBB par2AxisAlignedBB,
      List par3List,
      IEntitySelector par4IEntitySelector) {
    int var5 = MathHelper.floor_double((par2AxisAlignedBB.minY - 2.0D) / 16.0D);
    int var6 = MathHelper.floor_double((par2AxisAlignedBB.maxY + 2.0D) / 16.0D);

    if (var5 < 0) {
      var5 = 0;
      var6 = Math.max(var5, var6);
    }

    if (var6 >= this.entityLists.length) {
      var6 = this.entityLists.length - 1;
      var5 = Math.min(var5, var6);
    }

    for (int var7 = var5; var7 <= var6; ++var7) {
      List var8 = this.entityLists[var7];

      for (int var9 = 0; var9 < var8.size(); ++var9) {
        Entity var10 = (Entity) var8.get(var9);

        if (var10 != par1Entity
            && var10.boundingBox.intersectsWith(par2AxisAlignedBB)
            && (par4IEntitySelector == null || par4IEntitySelector.isEntityApplicable(var10))) {
          par3List.add(var10);
          Entity[] var11 = var10.getParts();

          if (var11 != null) {
            for (int var12 = 0; var12 < var11.length; ++var12) {
              var10 = var11[var12];

              if (var10 != par1Entity
                  && var10.boundingBox.intersectsWith(par2AxisAlignedBB)
                  && (par4IEntitySelector == null
                      || par4IEntitySelector.isEntityApplicable(var10))) {
                par3List.add(var10);
              }
            }
          }
        }
      }
    }
  }