Esempio n. 1
0
  protected void a(EntityLiving entityliving, boolean flag) {
    if (!(entityliving instanceof EntityCreeper) && !(entityliving instanceof EntityGhast)) {
      if (entityliving instanceof EntityWolf) {
        EntityWolf entitywolf = (EntityWolf) entityliving;

        if (entitywolf.isTamed() && this.name.equals(entitywolf.getOwnerName())) {
          return;
        }
      }

      if (!(entityliving instanceof EntityHuman) || this.C()) {
        List list =
            this.world.a(
                EntityWolf.class,
                AxisAlignedBB.b(
                        this.locX,
                        this.locY,
                        this.locZ,
                        this.locX + 1.0D,
                        this.locY + 1.0D,
                        this.locZ + 1.0D)
                    .grow(16.0D, 4.0D, 16.0D));
        Iterator iterator = list.iterator();

        while (iterator.hasNext()) {
          Entity entity = (Entity) iterator.next();
          EntityWolf entitywolf1 = (EntityWolf) entity;

          if (entitywolf1.isTamed()
              && entitywolf1.I() == null
              && this.name.equals(entitywolf1.getOwnerName())
              && (!flag || !entitywolf1.isSitting())) {
            entitywolf1.setSitting(false);
            entitywolf1.setTarget(entityliving);
          }
        }
      }
    }
  }